Any Node-red expert in support?

Hi everyone :slight_smile:

This weekend I achieved what is an accomplishment for me: using Node-RED so that Telegram sends me a message with a photo when my outdoor camera detects a human.
A small step for some… haha

Anyway it works, but I’d like to be able to use this camera/photo via Telegram when an intrusion is detected in the house.

My problem: in Node-RED I don’t know how to go about making a trigger coming from Gladys start a series of actions.

My cascade of actions would look like this:

  • When my MQTT fake device « intrusion Â» in Gladys switches to active
  • Then I tell Node-RED
  • Node-RED should send me the photos from my cameras at time T

But I don’t know how to translate this starting condition in Node-RED, there’s no If / else / then

Any ideas?

Hi,

Quickly you can use a switch with your fake MQTT device as the input

If your device equals 0 then you select the first output from the top

If your device equals 1 then you select the first output from the bottom

So if your active state corresponds to the value 1 then you can connect your Telegram function after it

Here is the switch detail

Otherwise you can also use a function and do a bit of JavaScript
image

2 Likes

That’s great! Thank you so much!! :grin:

1 Like

Hi, it would be great if you could make a tutorial for that @guim31.
I’ll write one as soon as I can for Node-RED and Sonos speakers.

1 Like

As soon as my flows are a bit « cleaner Â» I’ll make a tutorial :+1:

2 Likes