hello experts,
i have two Rpi's with Domoticz and want to use a switch button on the client to switch a light on the server and v.v. via MQTT
Sounds simple but can't get it work.
assume i have a situation like mentioned in "https://www.domoticz.com/wiki/MQTT#Architecture" where "other" is my second Rpi.
Can i use "on Action/Off Action" at edit light-switch ?
Thanks,
RPI 3
Mysensors gateway,
rflink Gateway
esp8266
MQTT switch on rpi1 and light on rpi2
Moderators: leecollings, remb0
- waltervl
- Posts: 5904
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: MQTT switch on rpi1 and light on rpi2
Why MQTT and not device sharing? https://www.domoticz.com/wiki/Setting_up_Device_sharing
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: MQTT switch on rpi1 and light on rpi2
If there is no specific need to use MQTT you could simply use
Code: Select all
http://<target domoticz ip: target domoticz port>/json.htm?type=command¶m=switchlight&idx=<target device idx>&switchcmd=On
http://<target domoticz ip: target domoticz port>/json.htm?type=command¶m=switchlight&idx=<target device idx>&switchcmd=Off
You will have to allow password-less access for your home LAN (Settings: LOcal Networks (no username / password) or include passwords in the JSON API for this to work.
Using this method you are not limited by the requirements of the shared devices setup (same endian / same version)
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: 48
- Joined: Monday 10 December 2018 23:32
- Target OS: Linux
- Domoticz version:
- Location: Poland
- Contact:
Re: MQTT switch on rpi1 and light on rpi2
I've done a Node-Red flow named Domoticz to Domoticz. You can adapt it to you. Is available on the node Red site.
With kind of switch device you use?
With kind of switch device you use?
-
- Posts: 37
- Joined: Sunday 23 July 2017 14:55
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2023.1
- Location: Haarlemmermeer
- Contact:
Re: MQTT switch on rpi1 and light on rpi2
tenx
let's dive into it this weekend.
should get something to work
let's dive into it this weekend.
should get something to work

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