On_value_range initial value after booting

Hi all !

I’m searching for a solution to trigger the function once after the device has booted.

From the documentation:

“This trigger will only trigger when the new value is inside the range and the previous value was outside the range. On startup, the last state before reboot is restored and if the value crossed the boundary during the boot process, the trigger is also executed.”

  • where is the last state stored ? RTC ?, flash?
  • can this be disabled, e.g. always assume zero at start

The use case is a RGB LED which should show the “humidity level” in green / yellow / red.
During the boot phase this LED is set to blue until the device is connected to HA.

As a result the LED stays blue until the humidity level exceeds the thresholds of on_value_range

Thanks for any hints !

You could set the state to the desired value in the on_boot trigger.

There is also an api.connected condition.