Have been struggling with this problem for days and no matter what I try I am unable to get there. I have a home assistant input number that I’d like to use in delay functions. But it requires a either a float or a string where I’d like to use an integer.
I want to use it to set the delay time in minutes.
I obtain the value from home assistant as follows:
sensor:
- platform: homeassistant
id: max_run_time_minutes
name: "Max Run Time - All Zones"
entity_id: input_number.irrigation_max_duration
I want to use it with the delay function of this block:
ESP Home complains that minutes expects a float. I tried to set up a global float but that doesn’t work either.
I have managed to use a substitution to set the delay time:
substitutions:
# Set Max Run Time Here: =============================#
max_run_time: "10min"
# Sets delay between switch turn on and switch turn off
#======================================================#
But I can’t figure out how to get that back to home assistant.
Although you may be better off converting into a variable, I can’t tell if the above format will work. I had to do a lot of this for the display component.
Thanks, I sure would like to assign it to a variable if I can figure out how. My understanding is that delay requires a string. I have used a substitution to set the delay…
OK, so it is not possible to define an initial value as a number only as a string? Even though, as per the example on the ESP Home site, it has been defined as an integer.
# Example configuration entry
globals:
- id: my_global_int
type: int
restore_value: no
initial_value: '0'