Skip to content

Commit

Permalink
Workaround for issue #1.
Browse files Browse the repository at this point in the history
Use a regex instead of the conversion from string to time.
  • Loading branch information
virgilm committed Jul 20, 2020
1 parent d35a582 commit bc4e9d8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/raspipool/flow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ sensor:
remain_cycles:
friendly_name: "Remain cycles"
value_template: >-
{% set nextcycle = strptime(states('sensor.cycle_pool'),'%H:%M').hour + strptime(states('sensor.cycle_pool'),'%H:%M').minute|int/60 %}
{% set hours = states('sensor.cycle_pool') | regex_replace(":[0-9]*$","") %}
{% set mins = states('sensor.cycle_pool') | regex_replace("^[0-9]*:","") %}
{% set nextcycle = (hours|int + mins|int/60) %}
{{(states('input_number.notify_cycles')|float - (states('sensor.cummulated_flow_low')|float + states('sensor.cummulated_flow_high')|float * 5) / (state_attr('input_datetime.recirculation','hour')+ state_attr('input_datetime.recirculation','minute')|float/60) )|round(1)}}
unit_of_measurement: ''
entity_id:
Expand Down

0 comments on commit bc4e9d8

Please sign in to comment.