Notification at specific temperature

Hello,
I'm an absolute beginner in Node Red, but I'm getting used to it. I have a Dragino lsn50-v2 sensor registered with TTN. Node Red and one
InfluxDB installed. In Grafana the temperature is displayed visually. So far so good.
The following data comes from MQTT:
v3/temperatur24ney@ttn/devices/temp001/up : msg.payload : Object
object
end_device_ids: object
correlation_ids: array[2]
received_at: "2024-05-14T06:57:32.881168746Z"
uplink_message: object
f_port: 2
frm_payload: "AQEBAQ=="
decoded_payload: object
ADC_CH0V: 0
BatV: 0.257
Digital_IStatus: "L"
Door_status: "OPEN"
EXTI_Trigger: "FALSE"
Illum: 0
TempC1: 25.7
Work_mode: "IIC"
rx_metadata: array[1]
settings: object
simulated: true
I want to be notified at a certain temperature. The node mail already works. How do I realize that? Thank you

You may have to edit your post.

Not a big problem, but it is difficult to read the structure of the message.

Also add some empty lines between things.
(Though that is limited to ONE at maximum.)

So edit it and where the actual payload is do this:

Add an empty line after the date come from MQTT:

Then click the button at the top of the edit area that looks like this: </>

type or paste code here

Put the payload (the message with which you need help) where it says `type or paste code here.

Perhaps you mean "at or above a certain temperature"?
It's very simple with a Switch node:

Yes, exactly, but I still need a function that then sends an email

If you look at the help for the mail node you can see what information you need to send to it.

" Sends the msg.payload as an email, with a subject of msg.topic "

After your switch node, insert a change node and use it to set these properties as required, and then pass to the mail node.

You might find it handy to include a delay node set to limit the rate of email generation.

Why?? It should only send an email if, for example, TempC1=> 1° Celsius.
What then are the properties of the change node?

The switch node determines the path of the message, the change node can add properties required for the email node e.g. -

I have already tested this with an inject node. Works well. But I can't implement it in my flow.

This is not the telling us anything about your flow.

I was referring to the image you posted previously.

Setup the switch node as per @jbudd suggestion and then add a change node after, per my suggestion.

Ah now I understand. I set the switch node msg.payload.TempC1 to >= for example 24° Celsius.
At 24° the rule comes from the change node and then the email node

1 Like

I recommend watching this playlist: Node-RED Essentials. The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.