OH2 and MQTT - Contact not working?

Good evening all!
I’m slowly migrating my system from OH1.8 to OH2 and I’m currently working on getting MQTT up and running.

I have my garage door hooked up to an ESP8266.
The buton to open/close the door is working well. But for some reason the contact that lets me know if it’s open or closed is not working quite right.

I’m watching the MQTT broker with an android MQTT client and I can see the messages coming in saying the garage sensor is…
Topic : homie/d406c6e0/garagesensor/open
Value : false

In my openhab log I see this…

2017-03-21 22:25:04.244 [WARN ] [b.core.events.EventPublisherDelegate] - given command is NULL, couldn’t post command for ‘Garage01Contact’

This is what my item looks like, I’ve pretty much copied it from my OH1.8 items file.

Contact Garage01Contact “Garage1” (AllItems) {mqtt="<[mosquitto:homie/d406c6e0/garagesensor/open:command:OPEN:true],<[mosquitto:homie/d406c6e0/garagesensor/open:command:CLOSED:false]"}

Any help would be greatly appreciated…

Anyone able to help with this?

Okay instead of using “command”, “state” seems to be working now.

Contact Gate01Contact “Front Gate” (AllItems, LogRRD4J, GroupOutdoors) {mqtt="<[mosquitto:homie/0fc787e0/gatesensor/open:state:OPEN:true], <[mosquitto:homie/0fc787e0/gatesensor/open:state:CLOSED:false]"}

Turns out “command” used to work on OH1.8 somehow even though it wasn’t supposed to :slight_smile:

1 Like