Thanks for the suggestion amelchio but for now the history stats sensor has solved the problem and I have no more false triggers. Until it is fixed with an official HA update here’s my code in case it helps anyone else:
within the sensor section of config yaml:
- platform: history_stats
name: PM1 Available
entity_id: switch.pm1_switch
state: "unavailable"
type: time
duration: 00:02:30
end: "{{ now() }}"
and added as a condition with the automation:
condition:
- condition: numeric_state
entity_id: sensor.pm1_available
below: '0.01'
The template condition is probably a neater way to solve it but I know this works so for now I will leave well alone.