Hello - I have been running OH2 for well over a year and everything has just been a breeze.
I decided to upgrade my system form a Rpi 3B to the 3B + , and while I am at it upgrade OH2 to the newest IMAGE.
I can not get the MQTT binding to work at all. Al the other times I did not have a single issue but this time I don’t know. I have gone through a lot of the threads but some are for an existing system that now has a bug of sorts.
So here is what my mqqt.conf looks like.
URL to the MQTT broker, e.g. tcp://localhost:1883 or ssl://localhost:8883
and for Items this is the format :
Switch relay1_1 “Bedroom 1 Light” (MH_Bed1, Lights) { mqtt="<[broker:domogik/out/relay/r1:state:MAP(onoff4.map)],>[broker:domogik/in/relay/r1:command:ON:1],>[broker:domogik/in/relay/r1:command:OFF:0],>[broker:domogik/in/relay/r1:command:TOGGLE:2]" }
and a Solar Item
Number solarwatt “Solar Watts [%.2f w]” { mqtt="<[victron:N/f46eiab8a1e88/solarcharger/256/Yield/Power:state:JSONPATH($.value)]" }
This setup is running perfectly under my “Current” system but if I run the new Openhabian Image and install the MQTT binding it does not receive any of the info. Did the format of the settings change? Am I missing something?
Did you just upgrade or are you doing a new install? - I am starting with a new install so that I have a new fresh system.
Ok some questions, forgive me if I am missing some stuff here -
As 99% of my system runs off MQTT , of witch most of them was from custom design thus generic, will I need to capture every device on its own or will I be able to do it via text?
I noted the example of the mqtt.thing file. Will I be able to create a file as per example and OH2 will be able to detect the item as per usual? I assume that I will need to place the file in the /etc/openhab2/things folder?
Don’t quite know what you mean by capture?
Only mqtt device following the homie convention and HASS can be detected and added as things automatically by the paperUI.
Thank you for the response! I started from scratch - as the main system is still running so I can learn the new format.
I managed to add the new MQTT connection with the new switch added. I also managed to add the switch to a new sitemap. So atleast I have managed to get that part to work.
More questions :
Where are the files located that is created by the paper UI and can I edit them directly or should it be moved to the default OH2 folders.
How can I apply a transformation to a switch state, the switch that uses reports the state in reverse so 1 = off and 0 = on. Previously I would add it the MQTT item but I can find the way to do it via the Paper UI.
I have added JSONPATH:$.device.status.set
For the On/Open value I have added 1
Switch ErIsPost "Er is post" {mqtt="<[mqtt:topic:MQTTgeneric:postSchakelaar]"}
if I don’t add the 1 in the channel setting i get an error
2019-11-09 09:35:45.680 [WARN ] [eneric.internal.generic.ChannelState] - Command '1' not supported by type 'OnOffValue': No enum constant org.eclipse.smarthome.core.library.types.OnOffType.1
with a 1 in it there are no errors but the switch didn’t change.
@vzorglub
It doesn’t matter if the switch is OFF or ON and it receives 1 nothing happens .
I am not using the Off value. The Switch Item is only visible if there is mail in my house-mailbox. With the switch I reset that the mailbox is empty and the switch disappear