How to know the status of SonOff relay MINI Zigbee using the Node-RED – Come conoscere lo stato del relè SonOff MINI Zigbee utilizzando Node-RED

If you like it, share it

This example show how to know the status of SonOff MINI DY ZigBee using the Node-RED.
For this example we use the iHost but is similar also on Home Assistant.
First we assume that you use node-RED on your iHost, se our doc here and here.
Second we use for this example the relay SonOff MINI DY ZigBee, see here.

Questo esempio mostra come conoscere lo stato del relè SonOff MINI DY ZigBee utilizzando Node-RED.
Per questo esempio utilizziamo iHost, ma la procedura è simile anche su Home Assistant.
Innanzitutto, supponiamo che tu utilizzi node-RED sul tuo iHost, consulta la nostra documentazione che trovi qui e qui.
In secondo luogo, per questo esempio utilizziamo il relè SonOff MINI DY ZigBee, vedi qui.

Below there is the example that turn ON or OFF the relay RL101 in case is sunset or sunrise, for details of sunrise and sunset see here
Also we check if the operations ad did correctly.

Di seguito è riportato un esempio di come accendere o spegnere il relè RL101 in caso di tramonto o alba, per i dettagli dell’alba e del tramonto vedi qui.
Verifichiamo anche se le operazioni sono state eseguite correttamente.

The node named:
Giorno(0) . Notte(1)
is actually based on:
eztimer
For details on how to use this component, see here.

Il nodo denominato:
Giorno(0) . Notte(1)
in realta è basato su:
eztimer
per dettagli su come usare questo componente vedere qui.

__________ NODO: test se GIORNO(0) o NOTTE(1)

__________ NODO: OFF – RL101

Below is very important node because convert the payload in input in a string to send to the payload in output.

Di seguito è riportato un nodo molto importante perché converte il payload in input in una stringa da inviare al payload in output.

__________ NODO: json

__________ NODO: switch

The two last node are debug node that show the result.

Gli ultimi due nodi sono nodi di debug che mostrano il risultato.

Below there are the results in case the Relay is not powered and when is powered.

Di seguito sono riportati i risultati nel caso in cui il relè non sia alimentato e quando è alimentato.