rogro82 / hass-variables

Home Assistant variables component
238 stars 58 forks source link

massive errors in set_variables with attributes #51

Closed Pirol62 closed 3 years ago

Pirol62 commented 3 years ago

suddenly, I receive these errors:

Logger: homeassistant.components.automation.last_motion
Source: helpers/script.py:1122
Integration: Automatisierung (documentation, issues)
First occurred: 14:34:41 (4 occurrences)
Last logged: 14:36:30

Last motion: Error executing script. Invalid data for call_service at pos 1: template value should be a string for dictionary value @ data['attributes_template']

The code:

    - service: variable.set_variable
      data:
        variable: last_general_motion_detected
        value_template: '{{now().strftime("%H:%M:%S - %d-%m-%Y")}}'
        attributes_template: >
          {
          "location": "{{trigger.to_state.attributes.friendly_name}}"
          }

It worked this morning. All other service calls producing errors as well.

Version: 0.118.3 Updated two days ago Hassio

Mariusthvdb commented 3 years ago

please check previous (and now fixed) issues: https://github.com/rogro82/hass-variables/issues/47

Pirol62 commented 3 years ago
variable: last_general_motion_detected
value_template: "{{now().strftime('%H:%M:%S - %d-%m-%Y')}}"
attributes:
  location: "{{trigger.to_state.attributes.friendly_name}}"

that works Thank you