so currently the cmnd to switch on the relay can be
1 for on
0 for off
2 for toggle on the topic : homie/megarelay/relay/r3
it will then respond with the state of the relay with
1 for on
0 for off on the topic; homie/megarelay/relay-state/r3
if I switch the relay via the sitemap it turns on but I get the following error ;
2019-01-03 12:59:11.333 [ome.event.ItemCommandEvent] - Item ‘relay3’ received command OFF
2019-01-03 12:59:11.345 [nt.ItemStatePredictedEvent] - relay3 predicted to become OFF
2019-01-03 12:59:11.359 [vent.ItemStateChangedEvent] - relay3 changed from ON to OFF
2019-01-03 12:59:11.364 [vent.ItemStateChangedEvent] - solarwatt changed from 776.8699951171875 to 742.0
==> /var/log/openhab2/openhab.log <==
2019-01-03 12:59:11.379 [WARN ] [eneric.internal.generic.ChannelState] - Command 'off' not supported by type 'OnOffValue': No enum constant org.eclipse.smarthome.core.library.types.OnOffType.off
2019-01-03 12:59:11.605 [ERROR] [ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve item for widget org.eclipse.smarthome.model.sitemap.Text
Also if I switch the relay externally from the state does update but not via the UI page ( I need to refresh the page to see the state of the relay)
Now I assume that there is a problem with the format of my mqtt topic’s and or the payloads but even if I change it to “on” / “off” instead of 1 and 0 it does not make any difference.
Thank you for the response David.
I have read through the Homie pages and was under the impression that it was a mqtt structure that was important but I realize that it is quite a bit more involved.
Unfortunately its above my average “coding” skills so it will need to be placed on the shelve for now until I have sorted the rest of the System.
Well, I have a Python script that runs on an RPi that lets me do stuff like scan for nearby Bluetooth devices, sense gpio pin states, change gpio pin states, etc. I use mqtt to get readings and control actuators from OH. I have it posted here : https://github.com/rkoshak/sensorReporter
I plan on implementing Homie so they can be automatically discovered.