Rule Coding question

If I put %Beer Fridge% is %value%.....will my speaker announce Beer Fridge is 50 degrees when the rule is triggered, or is this not how this works in this description in the screenshot?

Help for the coding illiterate please

%device% is %value% degrees I believe is what you are wanting.

Yeah right now it speaks just what I have for the message "Fridge Too Warm".....I wasn't sure by looking at that %device% stuff if I am able to make it state The Beer Fridge (the actual device name) is 'X" degrees, when the rule triggers after the temp goes above 50 degrees, If I can do this I wanted to change it to it?

Give that a shot, should work as you are wanting. I have one that says wife's car has arrived home when the presence sensor in her car is detected.

So do I replace the %device% with %Beer Fridge% and then %value% ? Is that how I would put it on the message to send line?

%device% and %value% are variable's for the sensor, so based on what sensor you have selected it will give that devices information. Look at your example under random message. It explains this, hopefully better then I am.

1 Like

If this trigger is only for one device (beer fridge) then don't use the device variable at all. Also, it depends on what the trigger is. If the trigger is the temp, then %value% will work. If the trigger is also the fridge being open or something else, then you could use a global variable. Basically, in the begging of your actions you'd want to set a global variable like %temp% to the sensor value of the Fridge. Then in your announcement you could use:
Beer fridge is %temp% degrees.
That would get around the trigger problem associated with using %value%, if you have one.

One reason to use %device% is that if the device name is updated, the rule would not need to be updated. Also thank you for providing additional enlightenment in to this subject. I enjoy learning from everyone's experiences and knowledge in the community.

That's true...but again, you run into the problem of what is actually triggering the rule. For example, most of my rules causing announcements also have the mode as a condition. That way the announcement starts again when the mode changes from Away to Home. In that case, the triggering "device" is actually the mode so it doesn't actually say the device you want it to. What ever "device" change it was that caused the rule to fire will be the %device% "variable" to RM. Even if it's not the logical one.

1 Like

Thanks for your insights, my uses have been fairly basic this far. It is great getting input as it gets the wheels spinning for more automation ideas.

1 Like

Some of the best ideas are those we steal borrow from others. :smiley:

You’re obviously not drinking enough beer because every time I go to the beer fridge I know whether it’s cold or not. :joy::stuck_out_tongue_closed_eyes:


+1,000,000 for that. LOL

My issue isn't that my beer fridge gets too warm; It's that it empties out too fast.

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