#370 More fine tuning to make sure it doesn't continuously restart the Juicebox.

This commit is contained in:
ccostan 2018-06-04 15:35:25 -04:00
parent ab65d38ac0
commit 53eba23cd7
1 changed files with 11 additions and 1 deletions

View File

@ -6,7 +6,6 @@
homeassistant:
customize_glob:
"*.carlojuice*":
homebridge_hidden: True
hidden: False
#-------------------------------------------
@ -55,6 +54,17 @@ automation:
- platform: state
entity_id: sensor.carlojuice_charging_status
to: 'disconnect'
for:
minutes: 5
condition:
- condition: template
value_template: >
{%- if states.automation.juicebox_selfheal.attributes.last_triggered -%}
{{ (as_timestamp(now()) - as_timestamp(states.automation.juicebox_selfheal.attributes.last_triggered)) > 40000 }}
{%- else -%}
true
{%- endif -%}
action:
- service: homeassistant.turn_on