I'm stuck trying to create this rule. With winter fast approaching, I want a way to announce which window or door is open (contact sensors) when the heat turns on (Nest thermostat). The rule fires but it announces that 'Heat is on and Nest Thermostat Hallway is open', when I want it to say ' Heat is on and Living Room Front Door is open'.
Any way to do this?
(trying to get a screenshot of my rule but it won't let me upload it...will keep trying)
Thing that trips the rule is the Nest changing from 'idle' to 'Heating' not that the thermostat is just set to 'Heat'. When this happens, I would like it to announce what window/door is open. That works, it just announces the wrong device.
The problem is that for %device% RM picks the last device that caused it to do something. In your case, that's the thermostat. So we have to figure out some other way to do it, where a door will be the last device causing something. That suggest two rules. One, is your thermostat kicking on. The other one just looks at doors and makes an announcement.
Edited: The second rule is tricky. Have to think a bit more about how to get it not to do anything until you want it to. A triggered rule won't work for it.
Oh, maybe try making rule truth of the first rule a condition of the second rule, but the doors are also conditions. So it will be looking at every door event, but won't do anything until the first rule becomes true:
Conditions: rule truth first rule true, doors open
Rule: rule truth first rule true AND doors open
Action: make the announcement
No virtual switch needed.
This is almost the rule you started out with, but the difference is that by breaking it into two rules, we get the thermostat out of the way of "last event device" --> that drives %device% in the announcement.
Hopefully I'm getting close. I made the two rules. I turned up my heat and the heat comes on turning the first rule True. I see it in the logs that the rule is true. The second rule doesn't run. It sees that the first rule is True based on the logs but in the rule it never changes to True. I have the door wide open, so the second part of rule 2 is always true. What am I missing!?
Oh, my bad. There is a bug in this version of RM for using Rule Truth as a condition, Found and fixed, and in the next release.
There is a work-around for now:
Instead of using rule truth in the second rule, use Private Boolean true as the extra condition. In the first rule, true part, set the Private Boolean of the second rule to true, and in the false part set it to false.
The very first time you hit done in the second rule, it will make the announcement on any door being open. You need the first rule to run a full cycle to get the Private Boolean synchronized with it.
Thanks for all your help, look forward to the next update. This time of year we are in the 40's at night and 60/70's during the day. Windows get a workout and many times get left open with the heat on. This will help big time!
Kept working on this since I like to tinker...Found a way to do this with 1 RM rule, 1 virtual device and 1 Check Open Contacts rule.
Created Virtual Switch with Enable Auto Off set to 1 second.
RM rule simply turns on the Virtual Switch when the heat kicks on (not just set to heat but actual furnace running, using Nest thermostat status).
Check Open Contacts rule triggers on the Virtual Device and checks all my windows and doors. Announces though the whole house which contacts are open (via google home assistants) and also sends me a push.
Best part is that, if anybody opens a window or door at anytime... this will catch it and notify us each time the heat kicks on.
Could not be happier! Thanks again.
For those interested, check out @Cobra's app here...