I have a virtual switch that sends HTTP requests for the On and Off action of the switch.
Now if the device that receives the requests is unavailable in the network, in the Domoticz log there is an error saying "Error opening url:" but the virtual switch still changes it's state.
Is there a way to produce a popup error saying the device can't be reached when the HTTP request fails?
Virtual Switch - HTTP Request
Moderators: leecollings, remb0
-
- Posts: 4
- Joined: Friday 19 February 2016 9:45
- Target OS: Linux
- Domoticz version:
- Location: Northern Holland
- Contact:
-
- Posts: 40
- Joined: Friday 29 January 2016 16:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Netherlands
- Contact:
Re: Virtual Switch - HTTP Request
The current implementation will only provide a log entry on failure. The best way forward is to create a script that is called in the on-off action of the switch instead of http-request directly. That way you could also implement with json() calls to reset to switch in case it was not successful.
-
- Posts: 4
- Joined: Friday 19 February 2016 9:45
- Target OS: Linux
- Domoticz version:
- Location: Northern Holland
- Contact:
Re: Virtual Switch - HTTP Request
Thanks. I will try that. So it is possible to reset the switch with JSON? That way I can update the status of the switch but not actually run the switch action?paulvha wrote:The current implementation will only provide a log entry on failure. The best way forward is to create a script that is called in the on-off action of the switch instead of http-request directly. That way you could also implement with json() calls to reset to switch in case it was not successful.
-
- Posts: 4
- Joined: Friday 19 February 2016 9:45
- Target OS: Linux
- Domoticz version:
- Location: Northern Holland
- Contact:
Re: Virtual Switch - HTTP Request
Okay, I found out I can update the status of the switch but not actually execution the action of the switch via "/json.htm?type=command¶m=udevice&idx=1&nvalue=0" So by using "nvalue".
-
- Posts: 40
- Joined: Friday 29 January 2016 16:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Netherlands
- Contact:
Re: Virtual Switch - HTTP Request
Yyour number 1 for idx could be correct
, but make sure you idx number is the same as for the device in the devices tab

Who is online
Users browsing this forum: No registered users and 1 guest