Hi all,
Is my first post and had been playing around with HA for a few weeks.
I came from a VBA background so I know a bit of programming, so I had tried the whole day figuring out how to do the following automation as I am still very new to the library (apologies in advance).
Current Set up:
- SNZB-06P presence sensor running with Zigbee2MQTT
- I had created a few scenes which turns on various lights in the living room
- I had used emulated hue so Alexa can execute the saved scenes via voice command - this feature adds to the complexity of my question; more on that shortly.
What I like to do (I will leave the off part later on as I think I know how to do it)
Triggers
- From 5PM to 6AM (this might be wrong, but I need some form of a trigger when someone is already in the room)
OR - Turn on scene A when the room’s occupancy has just been detected (someone just came into the room)
Conditions
- when no scenes are currently switched on - so it doesn’t change to scene A when I already have scene D on
- if the room is occupied
- Applicable only from 5PM to 6AM
Action:
- turn on scene A
My issues:
- Is there a way to retrieve the occupancy status via’s sensor’s attribute? like what we can see on the logbook?
- I know scenes are stateless, so I know Helpers is a great way to add them as part of condition IF a scene is already on.
I can imbed this Helper in other automations to switch the Helper’s value to true so it can be part of the condition when it only execute if it’s false (reset to false when things gets turn off).
However, if any of the scenes were executed by Alexa it will always be false (since I can’t change an Entity’s value via scene. Is there a way on the configuration.yaml file where I can change the helpers value to true? Or can I use automations instead of scenes on the configuration.yaml file so when Alexa calls the command, it will change the helper’s value to true?
I might be going this the wrong way, so I appreciate if anyone can point me to the right direction. I watched a lot of YT and read a lot of posts already so I am just a bit stuck and I am sure is something simple and I might be over thinking things or just not the most logical. Thank you!