Tell me how cold it outside each morning

I can’t figure out how to receive daily temperature alerts from my Zooz sensor.

I would like something like this:

At 7:30am, send notification to iPhone.
Message would read: “the temperature outside is x degrees”

The temperature would be based on what the Zooz sensor reports.

A push notification is fine, and works for other rules I’ve set up, where the message is purely text and doesn’t pull in variables.

Appreciate the help.

1 Like

Use Periodic Schedule as trigger for the rule. Create a local variable in the rule, and stick the temperature in with Sensor Value for your sensor. Then Send Notification with %variable-name% in the message, using the local variable you created.

5 Likes

Thanks that worked. Never used local variables before but will now!

Should I add a delay to make sure the local variable has been set? In my rule, I placed a 30-second delay, and the I have message sent to my phone. I figured the local variable might need some time to set?

As with most internal events, the setting of variables happens blazingly fast. See if the rule works before trying to pad it with delays and such. I think you'll be pleasantly surprised.

1 Like

No need. It happens just when you set it, no lag at all.

1 Like

Very cool guys. Works just as you suggested.

1 Like

Great idea.

Going to let this be a "wakeup greeting" via Sonos.

So to get "EVERY" day in the Periodic Schedule you used n=1 right ?

EDIT:

(Nevermind, the n=1 is obvious)

What isn't so obvious is best practice naming conventions for variables. I just created "Temp - Greenhouse" then went in to use this in the %variable-name% and went oooooh those capital letters and spaces and the dash are NOT a good idea. While RM might handle it I can't be guaranteed to remember it exactly. Obviously I got carried away with the flexibility, in the ole days that woulda been tempgreenhouse. I see I can't edit this, gotta delete. Best undo the use of it in the %variable-name% message first I assume.

1 Like

1 Like

Should be OK. There are some disallowed special characters that Hub Variables and Local Variables both announce and prohibit. But otherwise, names are pretty flexible. There is a bug associated special characters in variable names in the context of Custom Attribute and Sensor Value (this rule), but that is squashed in the upcoming hot fix release.

1 Like

Thanks BUT...
if I get sloppy and don't get the caps or the space-space exactly as created I'm gonna be in trouble right?

EDIT:
I'm not gonna lie, there's a whole-nuther-level of "quick satisfaction" in putting together a helpful little automation/announcement with these tools compared to cranking through to the successful compilation of a FORTRAN program that analyzes a pile of data. :face_with_spiral_eyes:

Well, spelling IS spelling, right down to every character, and they are case sensitive.

1 Like

Im trying to set this up myself for my ecowitt weather station to report the temp in the morning.

I can't seem to get my head around the local variable as I've never used them before.

So i create a local variable

Name: outside temp
Type: String
Value {What do i put in here}

Im confused what i put in the value field? My temp sensor is called outdoor ecowitt

Then when i set the action to run id put in the rule the notification 'outside temp is %variable-temp% this morning?

Im confused ,anyhelp would be great

Thanks

@jim273 I've just tried this on mine to see how it's done and get you a screen shot. String won't work. You want Decimal then set the initial value to any decimal value (as your rule will change it to match the value from your ecowitt the first time the rule triggers). When I set string, then set my action as set variable, choosing my temperature sensor - there was no option to pick "temperature" as it is a decimal value not a string. Here's the action:

And the entire rule:

Hope that helps

You could play with that further using If Then statements to change your announcements/notifications according to a temperature threshold.

1 Like

Thankyou very much, couldn’t get my head around it before but all working now

Thanks again

No problem - I learned something myself to be honest. I'm might set one for 10AM and further modify it so that if it's >20 degrees announce on Sonos "The temperature is xx degrees outside" then follow it with a sample of Bill Withers "and I know it's gonna be, a lovely daaaaaaaaaaaaaaaaaaaaaaaaaaaay" !

1 Like

Now there’s an idea :slight_smile: