Trying to set a input_text value using value_template with a sensor value

I’m getting the follow message from the log:

Invalid service data for input_text.set_value: extra keys not allowed @ data[‘value_template’]. Got “{{states(‘sensor.battery_frontdoor’) | string }}\n” required key not provided @ data[‘value’]. Got None

Any idea on what I’m doing wrong, or another way to set the input_text within an automation?

  action:
    - service: input_text.set_value
      data:
        entity_id: input_text.fd_battery
        value_template: >         
          {{states('sensor.battery_frontdoor') | string }}

Got it:

  action:
    - service: input_text.set_value
      data_template:
        entity_id: input_text.fd_battery
        value: "{{states('sensor.battery_frontdoor') | string }}"
4 Likes

Please mark the issue resolved by clicking on the checkbox icon in your second post so others looking to provide help don’t take time to read this when you no longer require help. Thanks! :slight_smile:

I don’t see one.

Looks like this:

image

I’m not seeing it.

Must be a bug in the forum software for iOS devices. It worked for desktop chrome.

Interesting. I know when you’re not the one that started the topic you won’t see those options. Maybe when you’re logged into the forum from your iOS device you’re using a different login, or it thinks it is a different user for some reason??? Anyway, thanks!