Taking the value from your screen shot, the above resolves to: 08:59:00 > 2022-02-09 which will be False. It will give seemingly inconsistent results because it is actually only comparing the leading digit of each side of the comparison (in this example: 0 > 2).
It will be False if the Input Datetime is set anywhere between 00:00-19:59 and True for 20:00-23:59.
To test if your Input Datetime is after 9AM, you need to tell it what day you’re interested in… since you are only interested in the time value, this is a same-day comparison and you can use:
Each time I press a button, it goes to ON.
What I want is to count the ON states.
Which I have achieved with the following automation :
alias: TEST FEEDBACK SENSOR
description: ''
trigger:
- platform: state
entity_id: binary_sensor.happy
to: 'on'
condition:
action:
- service: input_number.increment
data: {}
target:
entity_id: input_number.feedback_sensor_happy
mode: single
It works fine.
My problem is that you can press the button constantly and this will add +1 as the state keeps changing to ON which is something I want to avoid.
So the condition I want is :
You press the button once then add increment +1
If you press again or constantly add nothing .
if you press again after 15 seconds add another +1 and wait again for 15 ‘’
Your example is not wrong but when I press the button it returns to false so the automation can’t proceed.
@123 Do you know if I can achieve the same directly to esphome ??
I have a button attached to a binary sensor and I was thinking of creating a template switch that will check if the binary_Sensor’s state changed more than X seconds to report ON.
thank you very much for your response. Would you please provide an example of how to use it ?
What the script will do? Why do I have to create a counter?