virgilm / sparkly

Swimming Pool Automation Systen with Raspberry Pi + Home Assistant
MIT License
14 stars 7 forks source link

Issue with flow template #1

Closed virgilm closed 4 years ago

virgilm commented 4 years ago

Curious if this happens to other people too.

Hass logs:

020-07-19 22:01:32 ERROR (MainThread) [homeassistant.components.template.sensor] Could not render template Remain cycles: UndefinedError: 'str object' has no attribute 'minute'

This seems to be because the following line in flow.yaml:

      {% set nextcycle = strptime(states('sensor.cycle_pool'),'%H:%M').hour + strptime(states('sensor.cycle_pool'),'%H:%M').minute|int/60 %}

sensor.cycle_pool seems to be a string and not a date, or the template seems to think so. It seems that strptime implementation is broken honestly.

Screen Shot 2020-07-19 at 1 48 13 PM

This seems similar to: https://community.home-assistant.io/t/convert-string-to-time/37303/2