Page 1 of 1

Use switch second pi

Posted: Sunday 08 December 2024 7:43
by Bospieper
Hello,
I have two pi's active in the same network. Is it possible to use, through a script for example, a switch on the other pi?
Grz.Piet

Re: Use switch second pi

Posted: Sunday 08 December 2024 8:17
by BazemanKM
YES

Code: Select all

if WP.active and Pomp.state == 'Off' and SensorDT.temperature > 0 then
        domoticz.openURL('http://IP_OTHER:8080/json.htm?type=command&param=switchlight&idx=49&switchcmd=On')

Re: Use switch second pi

Posted: Sunday 08 December 2024 9:01
by Bospieper
Thanx I will try

Re: Use switch second pi

Posted: Sunday 08 December 2024 9:37
by Bospieper
Hello,
It works!
Next question: is it possible to use the command .afterMin() to build in a delay?
Grz Piet

Re: Use switch second pi

Posted: Sunday 08 December 2024 9:41
by HvdW
Domoticz remote is a great way of sharing.
You can choose which devices are shown in the other domoticz instance.
https://wiki.domoticz.com/Setting_up_Device_sharing

Re: Use switch second pi

Posted: Monday 09 December 2024 18:52
by BazemanKM
Bospieper wrote: Sunday 08 December 2024 9:37 Hello,
It works!
Next question: is it possible to use the command .afterMin() to build in a delay?
Grz Piet
Try and you will know. Let us know.

Re: Use switch second pi

Posted: Monday 09 December 2024 18:54
by BazemanKM
HvdW wrote: Sunday 08 December 2024 9:41 Domoticz remote is a great way of sharing.
You can choose which devices are shown in the other domoticz instance.
https://wiki.domoticz.com/Setting_up_Device_sharing
Also possible, but that was not the original question.

If the delay doesn't work, then slave/remote is an option with the delay.

Re: Use switch second pi

Posted: Tuesday 10 December 2024 0:04
by waltervl
BazemanKM wrote: Monday 09 December 2024 18:54
HvdW wrote: Sunday 08 December 2024 9:41 Domoticz remote is a great way of sharing.
You can choose which devices are shown in the other domoticz instance.
https://wiki.domoticz.com/Setting_up_Device_sharing
Also possible, but that was not the original question.

If the delay doesn't work, then slave/remote is an option with the delay.
I also think that device sharing between 2 Domoticz servers is exactly what the topic starter should use to switch a device on another Domoticz server.