Hello all,
I have a problem using the http binding in conjunction with a switch item.
things file:
Thing http:url:goveeH6072 "govee H6072 Lyra" [ baseURL="http://127.0.0.1:3666?device=ArbeitszimmerLED", ignoreSSLErrors=true, refresh=10] {
Channels:
Type switch : StatusSwitch "govee H6072 Lyra StatusSwitch" [stateTransformation="JSONPATH:$.response.data.onOff∩MAP:govee_status_onOff.map", stateExtension="&action=devStatus", onValue="on", offValue="off", commandExtension="&action=%2$s", mode="READWRITE"]
Type string : StatusString "govee H6072 Lyra Status" [stateTransformation="JSONPATH:$.response.data.onOff∩MAP:govee_status_onOff.map", stateExtension="&action=devStatus", mode="READWRITE"]
}
items file:
Switch goveetest {channel="http:url:goveeH6072:StatusSwitch"}
String goveeStest {channel="http:url:goveeH6072:StatusString"}
map file:
1=ON
0=OFF
The funny thing now is that the string item “goveeStest” is always updated, but the actual switch item “goveetest” is not.
I can change the on/off state by switch and it is switched (the real light goes on/off), but the state of the switch item “goveetest” goes to UNDEF afterwards. The string item “goveeStest” changes the status correctly.
This is how it looks in the log:
2023-05-22 16:40:15.230 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'goveetest' received command ON
2023-05-22 16:40:15.231 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'goveetest' predicted to become ON
2023-05-22 16:40:15.232 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'goveetest' changed from UNDEF to ON
2023-05-22 16:40:22.761 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'goveeStest' changed from OFF to ON
2023-05-22 16:40:22.761 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'goveetest' changed from ON to UNDEF
I have already set the http binding, the map and json transformation to DEBUG and there the status is also reflected correctly.
I’m not getting anywhere here and hope for your help
raw response of the http call:
{"request": "devStatus ArbeitszimmerLED ", "response": {"cmd": "devStatus", "data": {"brightness": 100, "color": {"b": 255, "g": 255, "r": 255}, "colorTemInKelvin": 2600, "onOff": 1}}}