Hmm, okay. Thank you for taking the time at explaining it to me.
Let me clarify on the sensor.time_charge_complete
entity. When the car is not connected to a charger, this entity will be “Unknown”.
Once the car connects to a charger, the sensor.time_charge_complete
will update and give the specific time the car will be finished charging at. I.e. 18 January 2023 at 21:16
.
When the car is unplugged it will go back to “Unknown”.
Right now the car is unplugged and the state is “Unknown”. I am testing my going to development page, and manually setting a state. However, it only takes 1 second before the entity goes back to “Unkown”. I manually set the state of the sensor with a value like so: 18 January 2023 at 18:40
and experiment with different times.
In this testing manner, I tried the new example you gave. Now, the automation does not trigger any more with a time that is further than 10 minutes in the future which is perfect.
Though it does now trigger at 10 minutes before, 9 minutes before, 8 minutes before and so on. It did not do this using the previous example.
Like I said, I test this by manually setting the state of the entity. I set the time 10 minutes in the future. (And the entity then goes back to Unknown right after. If I then update the time to 9 minutes in the future, the automation triggers again.
In a real world scenario, the sensor.time_charge_complete
will not go back to Unknown until after the car is completely done charging.
So, is it just my testing that gives false positives, whereas real world scenario where the sensor.time_charge_complete
entity doesn’t bounce back and to “Unknown”, it would in fact not trigger at 10,9,8,7… ?
EDIT A quick and dirty fix is I could set a boolean as a condition, so that the automation would only trigger once a day.
EDIT Checking the entity, I also see it has assumed state true. Maybe this is the culprit?
assumed_state: true
attribution: Data provided by Tesla
device_class: timestamp
icon: mdi:timer-plus
friendly_name: Catmobile Time charge complete