Home / Community / Blog

How to switch light using 3 channels 433MHz switch. It's very simple:

1 RF signal

My 3 button 433MHz switch sends 3 codes:

  • 672BE2- left button
  • 672BE8 - center button
  • 672BE4 - right button

2 MQTT publish

I set up RF Bridge to send MQTT messages like this (center button):

{
  "RfReceived" : {
    "Sync" : 7840,
    "Low" : 250,
    "High" : 780,
    "Data" : "672BE8",
    "RfKey" : "None"
  }
}

to topic:

tele/DVES_B2EFB9/RESULT

Domoticz needs to get mesage with topic:

domoticz/in

with payload like this:

{
  "idx" : 22,
  "command" : "switchlight",
  "switchcmd" : "Toggle"
}

We need to translate:

3, 4 and 5 message translation

Mosquitto and Node-RED are deployed using Docker on same machine:

docker run -it -p 1883:1883 -p 9001:9001 --name mosquitto \
-v mosquitto:/mosquitto/config -v mosquitto:/mosquitto/data \
-v mosquitto:/mosquitto/log eclipse-mosquitto

docker run -d -p 1880:1880 --restart=always  \
--log-opt max-size=10m --log-opt max-file=5 \
-v node-red-data:/data --name nodered \
--link mosquitto:broker nodered/node-red-docker:slim

You can see that I've link mosquitto container as broker.

The switch node splits messages depending on msg.payload.RfReceived.Data, and change node set properties (idx, command and switchcmd)

Here you have complete Node-RED code.

Finally Domoticz tuns the light!

Of course you have to have set up Domoticz first.

To change start page I've added in site.ini.append.php file in SiteSettings section:

[SiteSettings]
IndexPage=/content/view/full/134/
DefaultPage=/content/view/full/134/

If you don't have Linux station an you would like to debug some application witch syslog you can use Visual Syslog Server for Windows.

It's quite useful application that can emulate real syslog server.

You can show logs in realtime with filtering capabilities.

Recently I've found interesting device - it is WiFi to 433MHz gateway.

I've used FlashESP8266 to flash sonoff.bin (6.2.1).

Connect 3.3V USB-RS232 interface to J2 (you won't need 5th - SDA - pin).

To program you have to set S2 switch to OFF position.

As You can see it is in ON (normal) position.

Future reading:

Three chanel 433MHz relays - it uses specific protocol:

Just my blog...

Mon Tue Wed Thu Fri Sat Sun
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31