I’m getting these 3 errors when attempting to set the state of an input_number:
2023-01-04 15:18:00.011 ERROR (MainThread) [homeassistant.components.automation.sprinker_water_control] Sprinkler Water Control: Choose at step 1: choice 1: Error executing script. Error for call_service at pos 1: Error rendering data template: Result is not a Dictionary
2023-01-04 15:18:00.014 ERROR (MainThread) [homeassistant.components.automation.sprinker_water_control] Sprinkler Water Control: Error executing script. Error for choose at pos 1: Error rendering data template: Result is not a Dictionary
2023-01-04 15:18:00.020 ERROR (MainThread) [homeassistant.components.automation.sprinker_water_control] Error while executing automation automation.sprinker_water_control: Error rendering data template: Result is not a Dictionary
The code in question is this:
action:
- choose:
- conditions:
- condition: and
conditions:
- condition: trigger
id: calc_rain_delay
sequence:
- service: input_number.set_value
target:
entity_id: input_number.sprinkler_rain_delay_days
data: >-
{% set rain_delay = (states('input_number.sprinkler_rain_delay') |
float(0)) %} {% if rain_delay >= 1.0 %}
{% set rain_delay = rain_delay - 1.0 %}
{% endif %} {% set addl_rain_delay =
((states('sensor.miriam_daily_rain')) | float(0) / 0.25) %}
{% set new_rain_delay = (rain_delay + addl_rain_delay) | round(0) %}
state: "{{ new_rain_delay }}"
The last statement of jinja seems to be the issue. How do I update the input number’s state using a dictionary?