How do I Notify on Temperature reading

Just got a new multi-sensor that reports temperature. I can see temperature posts into the logs, now I want to send the temperature via a notification.

Here's what I got and it's not working:

What value variable do I use in the %---% to include the temperature reading? If I have to save it to a variable first, how do I do that?

I think %value% should do what you want.

1 Like

Tried that . %value% returns zero.

%value% should work. Did your rule actually trigger? It's set to the value of the triggering event. If you just try "Run Rule Actions," there is no trigger, and the value will not be updated. It should work when your sensor actually generates an event.

1 Like

Thanks that may be the issue. it was reporting zero for %value%. So unless there is a log entry for temperature from this device, it will continue to report zero?

Also, I tried doing it in Dashboard. It shows the last temperature reading. If there a way to get the last reading into a rule just like dashboard does?

No, unless you save it as a variable.

yeah, you have to save to a variable (and I think if you want in a dashboard it has to be a hub variable). The action to set it looks something like this:

1 Like

It should really be the last value, not necessarily zero, and for new rules probably null. What really matters is the event (check "Events" on the device detail page for an authoritative source), though by default most drivers will also log an "info" log entry for those, too.

As @aaiyar mentioned, you could save the device attribute value to a variable and use it that way if needed. But for your rule, unless you're using the rule in an additional way (e.g., running the actions from a different rule), you wouldn't need it. It will work with "real" triggers.

1 Like