You can immediately see, that while the battery is immediately recognized and value assigned (4.15 V), the Status is in an UNDEF state. Below the point definition
Below the Thing definition and the relevant channels. FYI, it is a Arduino based system (self-programmed) with a single micro-controller acting a gateway for all sensors and communicating with the MQTT broker (publishing channels, sending updates).
Yeah, that’s what I was suspecting, as you’re sending ON and OFF. I don’t use the Homie convention, so don’t quite recognise this configuration page. What options have you got for Data Type? Is this all the page shows, or are there more options?
Or, I guess, change your code to send 1/0 or true/false?
Actually I am sure there are a couple of guys around in the community who are rolling their eyes and laughing like mad
I found this post and I understood the whole issue
Contact accepts OPEN and CLOSED states only - ON/OFF are related to switch type
Actually homie specs define only true/false as valid payloads
BUT, since I am the owner and master of my sensors I just reprogrammed the gateway to send OPEN and CLOSED, violating the specs but avoiding the issue @rossko57 described (channel transformation maps to a string and makes the value unusable for Contacts)
That issue should now be fixed in OH3 - a transform profile still yields strings but any type Item will (try to) parse it into something suitable for the Item state. So a transform profile yielding “OPEN” should work with a Contact type Item.