I’m not sure where you are editing that, is it just a text editor and you are playing with concepts? Several things in your automation aren’t real (was this ChatGPT or something?). Also, using device ID’s is generally a bad idea for future maintenance unless there’s just no way to get the trigger you want from an entity state.
trigger:
- platform: numeric_state
entity_id: sensor.AC_lr_temperature
above: 25.5
for:
hours: 0
minutes: 0
seconds: 15
condition:
- condition: and
conditions:
- condition: time
after: "08:00:00"
before: "22:55:00"
- condition: state
entity_id: yxyxyxyxyx (id here)
state: (state you want to constrain with)
- condition: state
entity_id: xyxyxyxyxyx (id here)
state: (state you want to constrain with)
action:
- service: climate.set_hvac_mode
data:
hvac_mode: auto
target:
entity_id: xyxyxyxyxyx (id here)
mode: single
There’s a / before trigger. Typo when creating the post?
Why do two devices need to be home at the same time? Is this one person or are you checking for two? It is better to test for the state of zone.home to be above 0 if you want “some one is home”. Tracking two devices for one person is tricky, especially if you do not always take both with you. It can be done, but we’d need to know more to get it right.
You don’t need the and condition block. And is the default for the conditions in the conditions list.
Also, what if you come home while it is already hot? Or it is already hot at 8:00? You need more triggers. Here’s a good read about it, be sure to read to the end:
Hi, thank you for your answer. As posted this was my first ever attempt. If you are referring to my entity_id: yxyxyxyxyx (id here), entity_id: xyxyxyxyxyx (id here) etc, yes, I wasn’t sure if I should post the Id’s here so I replaced them with xx, yy… etc
Then I was right, and you should test zone.home to be above 0. It counts the number of people in the zone. You could also use an or with the trackers, but that is harder to maintain should you ever change device, or increase the number of persons in your household.
Have you thought about what to do when the first person comes home and it is already hot? This automation will not set AC to auto the way it is now. The automation should be set up something like:
Aha… I was not exactly sure what that will do so I entered 15sec to try and see. Does that mean that the sensor temperature have to be above 25.5 for at least 15sec?
Right again. You’ll get there fast In a trigger it is exactly that time, in a condition it is at least that time. Very useful for situations like: if there’s no motion for 2 mins, turn the light off.