Quite often an automation should fire only when multiple sensors are in some state. There is painful duplication required to list each item as a trigger as well as a condition, as well as assigning a period that it must be in this stage. For 90%+ of automations this just makes it hard to write and maintain.
There are a few ways to improve this. One would be to have a “trigger helper” which implements the AND logic, allowing multiple triggers to be associated with it, similar to what can be done with conditions. It would trigger when all then entities were in their designated state.
A second complaint: if a trigger/condition is not assigned a positive time, it will never be considered true, which is the opposite of what I would expect; it should mean that as long as its current value meets the criterion, it passes, regardless of how long it’s been in that state.
That’s a template sensor helper, which you can configure to combine various states.
A trigger is an event (in English terms, not HA terms): it is a moment in time when something changes. There’s no concept of “and” with triggers — the triggers+conditions pattern you’re complaining about is the logical way to implement things, which you could outsource to a template sensor if you wanted.
So if you wanted something to happen when the sun comes up but not before 06:00, the “usual way” would be thus:
triggers:
- trigger: time
at: "06:00"
- trigger: state
entity_id: sun.sun
to: 'above_horizon'
conditions:
- condition: time
after: "05:59"
- condition: state
entity_id: sun.sun
state: 'above_horizon'
Instead, you could define a template binary sensor helper:
{{ now().hour > 5 and is_state('sun.sun','above_horizon') }}
and just trigger off that:
triggers:
- trigger: state
entity_id: binary_sensor.sun_up_after_six
to: 'on'
Both of these approaches are available now. What changes are you wanting to see?
What? For a trigger, yes, something must change. For a state condition, it passes whenever tested regardless of the amount of time it’s been in that state.
You might need to add an HA restart / automations reloaded trigger if that’s the problem.