Hello,
Long time lurker of what Openhab can do compare to other home automation solutions. I ran it for a while but then decided to migrate to k8s (yes, I like problems) and now what to put Openhab back into the home stack.
- Platform information:
- OS: talos 1.8.4
- openHAB version: docker build version 5.0.0 SNAPSHOT
- Issue of the topic: Using http binding and jsonpath/map transformations to get/push commands on a GCE IPX800v4
I’ve been browsing doc and forums for a while and my setup is rather simple compare to a lot of what’s been achieve so far in this forum.
I’ve read a thread to explain how to use this http binding and some webhooks to have realtime update, I have no need for realtime update and prefer to keep it simple. I’m sure I’ve done this succesfully in the past but with my migration to k8s I’ve put openhab on hold for a while (it was v3 back then).
The “push” commands are working like a charm, aka I bind a switch on a UI to that light, and commands are pushed to the IPX (my light turn on and off!)
However, when I change something from IPX side (I use the physical switch, or IPX gui/api), the binding “sees” it set the item state to UNDEF
UID: http:url:6ad004add1
label: IPX
thingTypeUID: http:url
configuration:
authMode: BASIC
ignoreSSLErrors: false
baseURL: http://192.168.4.225/api/xdevices.json?key=apikey&
delay: 0
stateMethod: GET
refresh: 300
commandMethod: POST
contentType: application/json
timeout: 3000
bufferSize: 2048
location: basement
channels:
- id: last-failure
channelTypeUID: http:request-date-time
label: Last Failure
configuration: {}
- id: last-success
channelTypeUID: http:request-date-time
label: Last Success
configuration: {}
- id: light_wc
channelTypeUID: http:switch
label: light switch
description: ""
configuration:
onValue: SetR=15
mode: READWRITE
offValue: ClearR=15
stateExtension: Get=R
commandExtension: "%2$s"
stateTransformation:
- JSONPATH($.R15)∩MAP(ipx_switch_value.map)
label: IPX light switch
type: Switch
icon: ""
groupNames: []
tags:
- Light
- Switch
map content for transformations
0=OFF
1=ON
2025-06-18 05:59:51.861 [TRACE] [ttp.internal.http.RefreshingUrlCache] - Requesting refresh (retry=false) from 'http://192.168.4.225/api/xdevices.json?key=apikey&Get=R' with timeout 3000ms
2025-06-18 05:59:51.862 [TRACE] [ttp.internal.http.RefreshingUrlCache] - Sending to 'http://192.168.4.225/api/xdevices.json?key=apikey&Get=R': Method = {GET}, Headers = {Accept-Encoding: gzip, User-Agent: Jetty/9.4.57.v20241219}, Content = {null}
2025-06-18 05:59:51.871 [TRACE] [p.internal.http.HttpResponseListener] - Received from 'http://192.168.4.225/api/xdevices.json?key=apikey&Get=R': Code = {200}, Headers = {Access-Control-Allow-Origin: *, Connection: close, Content-Type: application/json, Cache-Control: no-cache}, Content = {{
"product": "IPX800_V4",
"status": "Success",
"R1": 0,
"R2": 0,
"R3": 0,
"R4": 0,
"R5": 0,
"R6": 0,
"R7": 0,
"R8": 0,
"R9": 0,
"R10": 0,
"R11": 0,
"R12": 0,
"R13": 0,
"R14": 0,
"R15": 1
}}
2025-06-18 05:59:51.871 [DEBUG] [ternal.JSonPathTransformationService] - about to transform '{
"product": "IPX800_V4",
"status": "Success",
"R1": 0,
"R2": 0,
"R3": 0,
"R4": 0,
"R5": 0,
"R6": 0,
"R7": 0,
"R8": 0,
"R9": 0,
"R10": 0,
"R11": 0,
"R12": 0,
"R13": 0,
"R14": 0,
"R15": 1
}' by the function '$.R15'
2025-06-18 05:59:51.872 [DEBUG] [ternal.JSonPathTransformationService] - transformation resulted in '1'
2025-06-18 05:59:51.872 [DEBUG] [ap.internal.MapTransformationService] - Transformation resulted in 'ON'
2025-06-18 05:59:51.873 [TRACE] [.HttpDynamicStateDescriptionProvider] - returning new stateDescription for http:url:6ad004add1:light_wc
2025-06-18 05:58:14.410 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'IPX_light_switch' predicted to become OFF
2025-06-18 05:58:14.411 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'IPX_light_switch' changed from ON to OFF
2025-06-18 05:59:51.873 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'IPX_light_switch' changed from OFF to UNDEF
I’ve tried some many config that I’m started to get lost now if I’m might be chasing something impossible without the webhook mentionned here. I don’t really care if there is a delay between someone pressing a real world switch and it getting reflected in openhab ui.
Thanks!