Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with flow template #1

Closed
virgilm opened this issue Jul 20, 2020 · 0 comments
Closed

Issue with flow template #1

virgilm opened this issue Jul 20, 2020 · 0 comments

Comments

@virgilm
Copy link
Owner

virgilm commented Jul 20, 2020

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

virgilm added a commit that referenced this issue Jul 20, 2020
Use a regex instead of the conversion from string to time.
virgilm added a commit that referenced this issue Jul 20, 2020
@virgilm virgilm closed this as completed Jul 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant