Enable hardware with script or API
Moderators: leecollings, remb0
- rolandbreedveld
- Posts: 156
- Joined: Wednesday 09 March 2016 11:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2021.1
- Contact:
Enable hardware with script or API
Hi all
I sometimes have an issue with my P1 interface, I have to disable and enable the "P1 Smart Meter USB" hardware to make it work again.
I want to do this automatic from my (=self-made) monitor-script, if possible with a api-call, but can't find how to do this, only to create/delete hardware.
Does anybody know how?
regards, Roland
I sometimes have an issue with my P1 interface, I have to disable and enable the "P1 Smart Meter USB" hardware to make it work again.
I want to do this automatic from my (=self-made) monitor-script, if possible with a api-call, but can't find how to do this, only to create/delete hardware.
Does anybody know how?
regards, Roland
Raspberry Pi(SSD)+UPS HAT,Dashticz on WallTablet,HomeBridge, P1, HarmonyHub,FritzBox,API to 123Solar+ABB-PowerOne+SMA,ESP-Leds(flashed LSC),Tasmota,Shelly,MQTT,Mosquito,Node-Red,http://wiki.breedveld.net/index.php?title=RPiWaterMeter, Mercedes-Me
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Enable hardware with script or API
@rolandbreedveld, [Me being political correctrolandbreedveld wrote: ↑Saturday 29 September 2018 18:53 I sometimes have an issue with my P1 interface, I have to disable and enable the "P1 Smart Meter USB" hardware to make it work again.
I want to do this automatic from my (=self-made) monitor-script, if possible with a api-call, but can't find how to do this

Unfortunately there seem to be no generic api-call to enable /disable hardware. The call varies per hardware type and other settings.
e.g. the call to disable my RFXcom is:
Code: Select all
http://DOMOTICZ_IP:DOMOTICZ_PORT/json.htm?type=command¶m=updatehardware&htype=1&port=%2Fdev%2FttyUSB-RFtrx433&extra=&name=RFtrx433&enabled=false&idx=3&datatimeout=0&Mode1=0&Mode2=11&Mode3=0&Mode4=44&Mode5=46&Mode6=64
Code: Select all
http://DOMOTICZ_IP:DOMOTICZ_PORT/json.htm?type=command¶m=updatehardware&htype=4&port=%2Fdev%2FttyUSB-P1&extra=&name=P1&enabled=false&idx=6&datatimeout=0&Mode1=1&Mode2=0&Mode3=0&Mode4=0&Mode5=0&Mode6=0
Code: Select all
http://DOMOTICZ_IP:DOMOTICZ_PORT/json.htm?type=command¶m=updatehardware&enabled=false&idx=3
you can find the api-call for your domoticz system by entering developer mode ( [CTRL][SHIFT]I in chrome) and there choose network when accessing the hardware tab in domoticz and disable / enable the hardware you are looking for. In the developer window you will see the json domoticz uses to perform the requested action.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
- rolandbreedveld
- Posts: 156
- Joined: Wednesday 09 March 2016 11:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2021.1
- Contact:
Re: Enable hardware with script or API
@waaren
Thanxzz, this wil do the job, didn't find this on the forum/wiki
regards, Roland
Thanxzz, this wil do the job, didn't find this on the forum/wiki
regards, Roland
Raspberry Pi(SSD)+UPS HAT,Dashticz on WallTablet,HomeBridge, P1, HarmonyHub,FritzBox,API to 123Solar+ABB-PowerOne+SMA,ESP-Leds(flashed LSC),Tasmota,Shelly,MQTT,Mosquito,Node-Red,http://wiki.breedveld.net/index.php?title=RPiWaterMeter, Mercedes-Me
- HansieNL
- Posts: 964
- Joined: Monday 28 September 2015 15:13
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Enable hardware with script or API
@rolandbreedveld I have the same problem. Once in a while the P1 stops working and disabling/ enabling the hardware solves the problem.
Can you share your script you are using to solve this problem?
Thanks in advance.
Can you share your script you are using to solve this problem?
Thanks in advance.
Blah blah blah
- rolandbreedveld
- Posts: 156
- Joined: Wednesday 09 March 2016 11:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2021.1
- Contact:
Re: Enable hardware with script or API
@HansieNL
solution is simple, set in the P1 hardware, the timeout at 15 minutes, this will restart the P1 service if dead.
solution is simple, set in the P1 hardware, the timeout at 15 minutes, this will restart the P1 service if dead.
Raspberry Pi(SSD)+UPS HAT,Dashticz on WallTablet,HomeBridge, P1, HarmonyHub,FritzBox,API to 123Solar+ABB-PowerOne+SMA,ESP-Leds(flashed LSC),Tasmota,Shelly,MQTT,Mosquito,Node-Red,http://wiki.breedveld.net/index.php?title=RPiWaterMeter, Mercedes-Me
- HansieNL
- Posts: 964
- Joined: Monday 28 September 2015 15:13
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Enable hardware with script or API
@rolandbreedveld Thanks. Didn't think about that solution. Sometimes things can be that simple



Blah blah blah
-
- Posts: 53
- Joined: Friday 16 September 2016 14:16
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Enable hardware with script or API
How to enable device ?
I'm able to disable but not enable:
I'm able to disable but not enable:
Code: Select all
wget -q -O - "http://192.168.1.11:8080/json.htm?type=command¶m=updatehardware&htype=41&name=MySensorsKinowaNano&enabled=false&
idx=2"
{
"status" : "OK",
"title" : "UpdateHardware"
}
wget -q -O - "http://192.168.1.11:8080/json.htm?type=command¶m=updatehardware&htype=41&name=MySensorsKinowaNano&enabled=true&i
dx=2"
{
"status" : "ERR"
}
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Enable hardware with script or API
On my system I to add &port=%2Fdev%2FttyUSB-RFtrx433 to the http to get it working for my RFtrx433 device.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
- Posts: 53
- Joined: Friday 16 September 2016 14:16
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Enable hardware with script or API
It works. Thanks a lot:
Code: Select all
wget -q -O - "http://192.168.1.11:8080/json.htm?type=command¶m=updatehardware&htype=41&name=MySensorsKinowaNano&enabled=true&i
dx=2&port=/dev/ttyUSB0"
{
"status" : "OK",
"title" : "UpdateHardware"
}
-
- Posts: 2
- Joined: Sunday 21 July 2019 9:16
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Enable hardware with script or API
I've got the same problem. During disable/enable the hardware is not available. I noticed that just "update" the hardware (with no changes, just press the update button) also fixes the problem, the hardware is still available. In my case Aeon Labs Aeotec Gen 5, one of the nodes seems lost the connection (Heal Node does not work). During the update all other nodes are still available.
So i prefer an update.
Is it possible to call update from commandline (script) ?
It would be perfect to test the nodes first, and only call the update if one of the devices are not ok
thanks
So i prefer an update.
Is it possible to call update from commandline (script) ?
It would be perfect to test the nodes first, and only call the update if one of the devices are not ok
thanks
-
- Posts: 2
- Joined: Sunday 21 July 2019 9:16
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Enable hardware with script or API
found it, in the reply of warren , thanks
Who is online
Users browsing this forum: Daro1003 and 1 guest