steilerDev / homebridge-openhab2-complete

A homebridge plugin for openHAB, that has the expectation to fully support all Services offered by Apple's Homekit Accessory Protocol (HAP)
GNU General Public License v3.0
52 stars 16 forks source link

Transform value "undef" #53

Closed Mr-iX closed 4 years ago

Mr-iX commented 4 years ago

After the OpenHAB restart, some of my items are in the state "undef". So because the add-on doesn't transform the state, the item is shown as not responding in the home app.

I think it would be good, when you transform undef to the state off.

[9/30/2019, 6:16:01 PM] [openHAB2-Complete] Received state: UNDEF (transformed to Error: Unable to transform UNDEF using transformation map {"OFF":false,"ON":true,"true":"ON","false":"OFF"}) for ITEM_SWITCH [Sonoff_Switch]
[9/30/2019, 6:16:01 PM] [openHAB2-Complete] Unable to transform UNDEF using transformation map {"OFF":false,"ON":true,"true":"ON","false":"OFF"}
skylord73 commented 4 years ago

Same issue with a different state: NULL can you expose the MAP file so we can adapt to different states? this solution will also solve issue #56

[11/21/2019, 10:20:50 PM] [openHAB2-Complete] Received state: NULL (transformed to Error: Unable to transform NULL using transformation map {"OFF":false,"ON":true,"true":"ON","false":"OFF"}) for Test Alexa [11/21/2019, 10:20:50 PM] [openHAB2-Complete] Unable to transform NULL using transformation map {"OFF":false,"ON":true,"true":"ON","false":"OFF"}

steilerDev commented 4 years ago

Undef and Null are both states within openHAB that represent a missing value or a communication error within openHAB. I want to show those errors within Homebridge and therefore I will not implement this.

As a suggestion: Create rules within OpenHAB to mitigate this problematic state.