I’m getting mentally prepared to upgrade my openhabian to version 2.4 - I think I understand everything that needs to be adjusted except the new MQTT binding.
I’d like to start by making a couple of points:
1- I’ve been reading all of the threads about the pre-release binding, it looks like a lot of work has gone into this! I appreciate it and I want to fully embrace the new and improved 2.4 powers
2- I’m confused about the attitude of the new binding - essentially the comment seems to be “use homie or home-assistant standards or may as well just keep the old binding”. Correct me if I’m wrong but isn’t that exactly opposite of what OpenHAB is all about? I understood the point of OH was to make everything work with everything, I thought OH was the software that tries to work with everything instead of us as users going and asking others to support OH…
Ok, on to my most troubling item. In the future I plan to replace Tasmota on this device (esp8266) with a custom Arduino sketch and Homie, but I have go in baby steps or things break in the house and my wife makes me unplug my automation toys.
I have this Item from the 1.x binding:
Switch MicroLight "Microwave Light" { mqtt=">[mybroker:cmnd/wemos2/POWER1:command:ON:ON], >[mybroker:cmnd/wemos2/POWER1:command:OFF:ON], <[mybroker:cmnd/relayState/POWER1:state:default], <[mybroker:tele/wemos2/SENSOR:state:JSONPATH($.Switch1)]"}
A little different but works great. The command for “on” and “off” are both “ON” because it toggles a relay on my wemos that “pushes the button” on the microwave for the light. Next we have the state coming back. This is a “switch” in tasmota or a GPIO high/low on the wemos. The tele/wemos2/SENSOR coming back is for reinitializing after openhab reboots.
And now my attempt at the 2.4 binding. Please be kind it’s my first try.
My attempted new Things:
Bridge mqtt:broker:myUnsecureBroker [ host="localhost", secure=false ]
{
Thing mqtt:topic:microwave {
Channels:
Type switch : highLight1 "Microwave Lamp 1" [ commandTopic="cmnd/wemos2/POWER1", on="ON", off="ON"]
Type switch : highLight2 "Microwave Lamp 2" [ stateTopic="cmnd/relayState/POWER1"]
Type switch : highLight3 "Microwave Lamp 3" [ stateTopic="tele/wemos2/SENSOR", transformationPattern="JSONPATH($.Switch1)"]
}
My attempted new Item:
Switch MicroLight "Microwave Light" {channel="mqtt:myUnsecureBroker:topic:microwave:highLight1", channel="mqtt:myUnsecureBroker:topic:microwave:highLight2", channel="mqtt:myUnsecureBroker:topic:microwave:highLight3"}
Am I close? Will this even work? Is it just me or is this much more complicated than the “old way” for this item?
I’ve read through the documentation and tried to adjust examples to my item. I also read David’s blog post from a couple of days ago about the new system and grabbed some helpful information there. Finally, this is just step 1 for this “thing” - I have the “low” light, “high” vent fan, “low” vent fan, and a temp/humidity sensor connected to the same ESP…