Sorry to start a new Topic on this… I have read or tried to see what others are doing to correct syntax issues when migrating from MQQT 1.x to MQTT 2.5.x. but am still unable to correct a couple of issues.
Somehow I got my temperature sensors to work, even though there is an additional “WARN” in the Openhab Logs:
2020-06-17 10:37:23.602 [WARN ] [ab.binding.mqtt.generic.ChannelState] - Command '97.2
' not supported by type 'OnOffValue': No enum constant org.eclipse.smarthome.core.library.types.OnOffType.97.2
==> /var/log/openhab2/events.log <==
2020-06-17 10:37:23.619 [vent.ItemStateChangedEvent] - greenhousetemp changed from 98.5 to 97.2
Man… as I type this, I see that this could be a very long post… so, in a nutshell:
I have a Raspberry Pi with a PiFace board attached (pi40) to control a relay to activate the Garage Door Button.
And, this same Pi reads the values of 3 Temperature sensors an the Garage Door contact status (Opened or Closed). I have python scripts that run every 2 minutes or so to grab the temperatures and every 10 seconds to check the G-Door Contact status. Using Node-Red and mosquitto on this same Pi, it publishes these values. This has worked quite well for a couple of years now.
The Openhabian Pi Runs openhab2, or course and subscribes to the above topics produced by the python code and Node-Red on Pi40. Now this is broken.
Previous syntax was this for the Temperature Sensors in 'home.items’:
Number frontporchtemp "Front Porch Temperature [%.1f f]" <temperature> { mqtt="<[openhabianpi:frontporchtemp:state:REGEX((.*?))]" }
Number garagetemp "Garage Temperature [%.1f f]" <temperature> { mqtt="<[openhabianpi:garagetemp:state:REGEX((.*?))]" }
Number greenhousetemp "Greenhouse Temperature [%.1f f]" <temperature> { mqtt="<[openhabianpi:greenhousetemp:state:REGEX((.*?))]" }
This is the current Syntax for home.items that works but with additional errors:
Number frontporchtemp "Front Porch Temperature [%.1f f]" <temperature> [ "CurrentTemperature" ] {channel = "mqtt:topic:pi40:frontporchtemp:temperature"} Number garagetemp "Garage Temperature [%.1f f]" <temperature> [ "CurrentTemperature" ] {channel = "mqtt:topic:pi40:garagetemp:temperature"} Number greenhousetemp "Greenhouse Temperature [%.1f f]" <temperature> [ "CurrentTemperature" ] {channel = "mqtt:topic:pi40:greenhousetemp:temperature"}
I have the pi40 MQTT defined as this:
So, I’m not sure what “WARN” message is referring to.
~~
Now that this part of my question is out of the way, here is the more complex part of my question.
Before MQTT Update, I was able to change the value of the Garage Door Button based upon the OPEN/CLOSED status of the door contact. That was done here in ‘home.sitemap’:
Frame label=“Doors” icon=“door”
{Switch item=gdoor1 icon="garagedoor" mappings=[ON=OPEN] visibility=[gdoor3 == CLOSED] Switch item=gdoor1 icon="garagedoor" mappings=[ON=CLOSE] visibility=[gdoor3 == OPEN] Switch item=gdoor1 icon="garage_detached_selected" mappings=[ON=NULL] visibility=[gdoor3 == NULL] Switch item=gdoor3 visibility=[gdoor3 == nothing] Group item=extras label="Garage Door Options" labelcolor=["blue"] icon="zoom" { Frame { Switch item=gdoor2 label="G-Door 2ft" icon="garagedoor" mappings=[ON=OPEN] visibility=[gdoor3 == CLOSED] Switch item=gdoor2 label="Garage Door" icon="garagedoor" mappings=[ON=CLOSE] visibility=[gdoor3 == OPEN] Switch item=gdoor4 label="G-Door 3inches" icon="garagedoor" mappings=[ON=OPEN] visibility=[gdoor3 == CLOSED] Switch item=gdoor3 visibility=[gdoor3 == nothing]
It would show this:
and this when expanded:
None of this is working properly now because it isn’t able to update the status of the contact properly.
The openhabianPi device should be subscribing to the garagedoor status and change OPEN to CLOSE depending on whether the contact is opened or closed. If Open, it will change the button to CLOSE, if door is closed, it will change to OPEN (the door)
I think in the past, the openhab log would show something like gdoor3 CLOSED or gdoor1 OPEN.
Now, the Log shows this:
2020-06-17 11:39:39.835 [WARN ] [ab.binding.mqtt.generic.ChannelState] - Command 'OPEN
' not supported by type 'OnOffValue': No enum constant org.eclipse.smarthome.core.library.types.OnOffType.OPEN
I have tried setting the MQQT THING to Text and Contact but with the same Log error.
I have tried changing this between String and Contact in the '.items’ file… but still no go:
Contact gdoor3 “Garage Door Status” { channel = “mqtt:topic:c5a4c312:readgaragecontactstatus” }
The bottom line, I just want this new MQQT Binding to do simple MQQT Subscribe and Publish, displaying the Topic and its value. One more note, if I run a MQQT Client on my phone or Windows Desktop, I get the format I want… but not in OpenHab2 anymore.
I see that I was using REGEX before, but I don’t see that it works for the new Binding version??
`
Contact gdoor3 “Garage Door” { mqtt=“<[openhabianpi:readgaragecontactstatus:state:REGEX((.*?))]” }
I’m EXTREMELY Sorry this was so long… but maybe it can help others IF someone can assist with the proper Syntax. I can provide any other info if needed.
Thanks,
Todd