Use switch second pi

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
User avatar
Bospieper
Posts: 166
Joined: Thursday 07 November 2019 10:26
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: NL
Contact:

Use switch second pi

Post 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
BazemanKM
Posts: 33
Joined: Wednesday 22 July 2015 21:39
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Use switch second pi

Post 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')
User avatar
Bospieper
Posts: 166
Joined: Thursday 07 November 2019 10:26
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: NL
Contact:

Re: Use switch second pi

Post by Bospieper »

Thanx I will try
User avatar
Bospieper
Posts: 166
Joined: Thursday 07 November 2019 10:26
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: NL
Contact:

Re: Use switch second pi

Post by Bospieper »

Hello,
It works!
Next question: is it possible to use the command .afterMin() to build in a delay?
Grz Piet
HvdW
Posts: 504
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

Re: Use switch second pi

Post 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
Bugs bug me.
BazemanKM
Posts: 33
Joined: Wednesday 22 July 2015 21:39
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Use switch second pi

Post 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.
BazemanKM
Posts: 33
Joined: Wednesday 22 July 2015 21:39
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Use switch second pi

Post 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.
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Use switch second pi

Post 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.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest