I would like to use write an automation that uses a not-condition including a state-condition with a specific duration. This is not working. Home Assistant is always claiming that the not-condition would be true.
Here is a example:
alias: test-oral-b
description: ""
trigger:
- platform: state
entity_id:
- sensor.io_series_7_8_53f9_toothbrush_state
from: charging
condition:
- condition: not
conditions:
- condition: state
entity_id: sensor.io_series_7_8_53f9_toothbrush_state
state: running
for:
hours: 20
minutes: 0
seconds: 0
action:
- service: notify.alexa_media_echo_og_bad
data:
message: Example sentence.
mode: single
I am aware that I could solve the problem with the help of a toggle-helper controlled by another automation. But I am writing a more complex automation that later is planned to become a blueprint a want to publish. I don’t want the users of my blueprint to add helpers be themself. That could be a showstopper for less experienced users.
I could also solve this problem with using the state-condition in a way that doesn’t require a negation. But this wouldn’t work in my use case because the device in question can have more than just two states and I am looking for a condition were a specific state didn’t happen for a given duration.
Another solution would be, if I could use a and-condition combining all possible states but the one in question. But then I have the problem that Home Assistant doesn’t seem to have the option to give a combined duration time for all state-conditions inside a and-condition.
Is this maybe an already known bug/limitation of Home Assistant?
Is there a way to solve this problem?