Maybe its late, but I keep looking at this and its still confusing me.
Take this rule
rule "Google Home Notification Play Sound"
Item GH_Notifications_AudioFile received command
if (Presence.state == ON && (vTimeOfDay.state != "RELAX" || vTimeOfDay.state != "BED"))
Presence is currently ON
vTimeOfDay is currently BED
Can anyone tell me why the code inside the “if” is still running? The idea is I dont get notifications when we are winding down for bed and during sleep.
(vTimeOfDay.state != "RELAX" || vTimeOfDay.state != "BED") evaluates to
"BED" because that means
vTimeOfDay is not
|| is OR.
if (Presence.state == ON && vTimeOfDay.state != "RELAX" && vTimeOfDay.state != "BED")
Thanks, I knew it was something with the logic, but you know when you stare at some thing too long.
This has been bugging me for a while.
Because it just occurred to me, I think what you thought you had was more like this (which will also work):
if (Presence.state == ON && !(vTimeOfDay.state == "RELAX" || vTimeOfDay.state == "BED"))
In words that is:
if Presence is ON and not ( TimeOfDay is "RELAX" or TimeOfDay is "BED" ) then
Ahh ok, that might actually read better. I’ll have a look at changing it.