Maybe its late, but I keep looking at this and its still confusing me.
Take this rule
rule "Google Home Notification Play Sound"
when
Item GH_Notifications_AudioFile received command
then
if (Presence.state == ON && (vTimeOfDay.state != "RELAX" || vTimeOfDay.state != "BED"))
{
GH_Notifications_Volume_Increase.sendCommand(ON)
playSound("chromecast:audiogroup:ab6e4b10-3831-4914-86c5-4a9b84a44144", receivedCommand.toString())
}
end
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.
Because (vTimeOfDay.state != "RELAX" || vTimeOfDay.state != "BED") evaluates to True if vTimeOfDay is "BED" because that means vTimeOfDay is not "RELAX". || is OR.
Try this:
if (Presence.state == ON && vTimeOfDay.state != "RELAX" && vTimeOfDay.state != "BED")