Anyone know how to add a number selector or text input as the user response? I want a user to select 1 to 24 (hours) so I can set a Timer.
thanks!
Anyone know how to add a number selector or text input as the user response? I want a user to select 1 to 24 (hours) so I can set a Timer.
thanks!
Not in the current script, but you’d be able to do so if you built the payload manually.
You’d have to handle a whole host of input validation though, or maybe run it through an LM to distill the numbers you want on the fly.
In a different thread someone answered with 2 separate sets of info. I’m super new to all of this I have no idea if adding what he suggests to your blueprint would be easy or makes sense?
Instead of messing with all the timers I would probably just use a Number Helper and template condition… if you use the slugified entity ID of the automation as the object ID of the
number
you could use the following condition in each automation:condition: - condition: template value_template: > {% set n_hours = states('number.'~this.entity_id | slugify) | int(0) %} {{ now() > this.attributes.last_triggered | default(as_datetime(0),1) + timedelta(hours = n_hours ) }}
There are limits to how many actions you can have… you can use the
REPLY
action to get a text input for your number.action: - action: notify.mobile_app_<your_device_id_here> data: message: "This is where the message goes" data: channel: automation_throttle_backyard_motion actions: - action: "REPLY" title: "Hours to Disable (1-24)"
One of the issues using a “REPLY” action is that you loose the ability to append the
context.id
to it to get a unique value for the Wait for Trigger. You can use unique channel ID’s to help with that.UPDATE:
Example taking advantage of the
textInput
behavior noted below:action: - action: notify.mobile_app_<your_device_id_here> data: message: "There's something moving in the Back Yard" data: channel: automation_throttle_backyard_motion actions: - action: "DELAY_TIMER_{{context.id}}" title: "Set Delay Hours (1-24)" behavior: textInput
@samuelthng can you expand “Device to notify” section to allow adding multiple Entities?