Httpbinding with openHAB version: 3.0
I try to turn on/off the schedule of my shellys by OpenHab. Unfortunately, this is not possible via MQTT so I wanted to realize this by the use of the http binding. The schedule can be turned on/off by these two http addresses:
Schedule Off:
http://172.16.1.14/settings/roller/0?schedule=false
Schedule On:
http://172.16.1.14/settings/roller/0?schedule=true
The actual state can be get via JSON (JSONPATH:$.schedule) from the following adress:
http://172.16.1.14/settings/roller/0
httpThings Code:
UID: http:url:Rollo_Schedule
label: HTTP URL Thing
thingTypeUID: http:url
configuration:
authMode: BASIC
ignoreSSLErrors: false
baseURL: http://172.16.1.14
refresh: 30
commandMethod: GET
timeout: 3000
bufferSize: 2048
channels:
id: Schedule
channelTypeUID: http:switch
label: Schedule
description: ""
configuration:
onValue: "true"
offValue: "false"
stateExtension: /settings/roller/0
commandExtension: /settings/roller/0?schedule=%2$s
stateTransformation: JSONPATH:$.schedule
If I turn off the schedule manually I can activate it with openhab but it is not possible to switch it off.
Here a part of my log file (starts with a deactivated schedule):
2021-05-07 19:36:10.047 [TRACE] [ttp.internal.http.RefreshingUrlCache] - Requesting refresh (retry=false) from 'http://172.16.1.14/settings/roller/0' with timeout 3000ms
2021-05-07 19:36:10.049 [TRACE] [ttp.internal.http.RefreshingUrlCache] - Sending to 'http://172.16.1.14/settings/roller/0': Method = {GET}, Headers = {Accept-Encoding: gzip, User-Agent: Jetty/9.4.20.v20190813}, Content = {null}
2021-05-07 19:36:10.079 [TRACE] [p.internal.http.HttpResponseListener] - Received from 'http://172.16.1.14/settings/roller/0': Code = {200}, Headers = {Server: Mongoose/6.18, Connection: close, Content-Type: application/json, Content-Length: 549}, Content = {{"maxtime":20.00,"maxtime_open":20.00,"maxtime_close":20.00,"default_state":"stop","swap":false,"swap_inputs":false,"input_mode":"openclose","button_type":"toggle","btn_reverse":0,"state":"stop","power":0.00,"is_valid":true,"safety_switch":false,"schedule":false,"schedule_rules":["2100-0123456-close","0600-01234-open","0700-56-open"],"obstacle_mode":"disabled","obstacle_action":"stop","obstacle_power":200,"obstacle_delay":1,"safety_mode":"while_opening","safety_action":"stop","safety_allowed_on_trigger":"none","off_power":2,"positioning":true}}
2021-05-07 19:36:16.531 [TRACE] [nding.http.internal.HttpThingHandler] - Sending to 'http://172.16.1.14/settings/roller/0?schedule=true': Method = {GET}, Headers = {Accept-Encoding: gzip, User-Agent: Jetty/9.4.20.v20190813}, Content = {null}
2021-05-07 19:36:16.733 [TRACE] [p.internal.http.HttpResponseListener] - Received from 'http://172.16.1.14/settings/roller/0?schedule=true': Code = {200}, Headers = {Server: Mongoose/6.18, Connection: close, Content-Type: application/json, Content-Length: 548}, Content = {{"maxtime":20.00,"maxtime_open":20.00,"maxtime_close":20.00,"default_state":"stop","swap":false,"swap_inputs":false,"input_mode":"openclose","button_type":"toggle","btn_reverse":0,"state":"stop","power":0.00,"is_valid":true,"safety_switch":false,"schedule":true,"schedule_rules":["2100-0123456-close","0600-01234-open","0700-56-open"],"obstacle_mode":"disabled","obstacle_action":"stop","obstacle_power":200,"obstacle_delay":1,"safety_mode":"while_opening","safety_action":"stop","safety_allowed_on_trigger":"none","off_power":2,"positioning":true}}
I just see the command in case that I turn the switch on but nothing happens if I turn the switch off. I don´t even see a entry in my log file. After I turned the switch off and on again the last two lines repeated. If I swap the onValue and offValue I just can turn the schedule off but not on again.