From 53eba23cd7746aa991314981a559e6374b99141e Mon Sep 17 00:00:00 2001 From: ccostan Date: Mon, 4 Jun 2018 15:35:25 -0400 Subject: [PATCH] #370 More fine tuning to make sure it doesn't continuously restart the Juicebox. --- config/packages/juicenet.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/config/packages/juicenet.yaml b/config/packages/juicenet.yaml index aa41d5bf..6d796ca1 100755 --- a/config/packages/juicenet.yaml +++ b/config/packages/juicenet.yaml @@ -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