Hi all,
tl;dr: I am trying to change the value of an input_text from a scene. I am trying to do this, so I can register an event change into custom:home-feed-card. When I do so, I get a “reproduce_state” error. Any hints on workarounds?
Context
I am using a “custom:home-feed-card” to see all the state changes at my home. Unfortunately, the card does not work well with scripts, automations and scenes.
My workaround was to create an input_text. The script and/or automation would change the value and that would then be registered on the card. Example:
- id: auto_turn_on_lights_living_room
alias: 'Auto: Turn on living room lights at night'
trigger:
- platform: sun
event: sunset
offset: '-00:30:00'
action:
- service: script.turn_on
entity_id: script.light_daily_light
- service: input_text.set_value
data_template:
entity_id: input_text.automation_run
value: 'Turn on living room lights at night'
When this happens, input_text changes, and I get a record on my home feed card with the name of the script/automation that was run and the time.
The error message
Now, while this works in automations and scripts, scenes do not have capabilities for calling services. Hence, I was trying to simply change the “value” field like this:
- name: event_easter
entities:
group.living_room_lights_except_entrance:
state: on
brightness_pct: 80
rgb_color: [239, 184, 77]
input_text.scene_run:
value: 'Event Easter'
When I do that, I get this error:
reproduce_state: Unable to reproduce state <state input_text.scene_run=None; value=Event Easter @ 2019-08-01T22:08:41.327347+08:00> (2)
Troubleshooting / Hypothesis
I have also tried with text
and state
. The former would simply replace “value” with “text” on the error (not sure why I tried text anyway as it’s not an attribute), the latter would just have the = for the state like: reproduce_state: Unable to reproduce state <state input_text.scene_run=Event Easter @ 2019-08-01T22:08:41.327347+08:00> (2)
. Aka: same error, just showing the attributes I am setting.
My first thought was that input_text does not have a set state method, or maybe one to read it (since it is called “reproduce_state”. The error line seems to be indicating something along these lines. It doesn’t seem to find the service to do so. My confusion is that from the States
tab on Hassio, I can actually see the current state and set the state to any random value. Hence, I am unsure what the underlying cause really is.
Solutions / Workarounds
My only thought at the moment is to create a script that would change the value. However, as far as I know, scenes cannot pass data/value parameters to the script. Hence, I cannot have a templated script where one script would change the value and the name of the scene will be passed to be set as the value (“Event Easter” on the previous example).
Creating one script per scene is also not very viable as I have somewhere between 20-40 scenes.
Any ideas or workarounds?
Thank you!