Hi.
I’m a little bit confused … I’m using this things definition for an Open/Close sensor.
Thing mqtt:topic:mymqtt:sensor_contact_az "MQTT Open/Close" (mqtt:broker:mymqtt) @ "MQTT Contact" {
Channels:
Type contact : contact "Contact" [
stateTopic="zigbee2mqtt/sensors/contact/az",
transformationPattern="JSONPATH:$.contact",
on="false",
off="true"
]
}
Via MQTT this is sent. "contact":true
means CLOSED
.
zigbee2mqtt/sensors/contact/az {"battery":100,"contact":false,"linkquality":0,"voltage":3055}
zigbee2mqtt/sensors/contact/az {"battery":100,"contact":true,"linkquality":0,"voltage":3055}
Item is defined in this way …
Contact sensor_contact_az_contact "AZ [%s]" <door> { channel="mqtt:topic:mymqtt:sensor_contact_az:contact" }
Unfortunately open/close can’t be shown.
During my tests, some-times I’ve got this messages…
[...] Tried to set invalid state OFF (OnOffType) on item sensor_contact_az_contact of type ContactItem, ignoring it
[...] Command 'true' not supported by type 'OpenCloseValue': No enum constant org.eclipse.smarthome.core.library.types.OpenClosedType.true
Any idea what can be wrong? Have already tried to find a solution using Google and this community, but didn’t found a good solution.
Thx, markus