2018-01-02 00:00:45 +00:00
#-------------------------------------------
# @CCOSTAN
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
2020-06-25 20:42:44 +00:00
# JuiceBox 40 Support - https://amzn.to/3eA95dV
# https://www.vcloudinfo.com/2018/06/using-home-assistant-to-fix-my-juicebox.html
2018-01-02 00:00:45 +00:00
#-------------------------------------------
2021-07-12 04:33:18 +00:00
# Moved to UI integration
# juicenet:
# access_token: !secret juicenet_access_token
2018-01-02 00:00:45 +00:00
2023-06-19 20:12:32 +00:00
command_line :
switch :
name : Restart Juicebox
unique_id : restart_juicebox_switch
command_on : "/usr/bin/curl -k 'http://192.168.10.91/command/reboot'"
2018-06-04 19:03:33 +00:00
2018-01-02 00:00:45 +00:00
#############################################################################
2020-07-02 18:50:39 +00:00
### Automations - Alerts related to the JuiceBox (https://amzn.to/2AZVQ37)
2018-01-02 00:00:45 +00:00
##############################################################################
automation :
- alias : 'Car Charging Alerts'
2020-07-20 18:33:03 +00:00
id : fa805e4a-08fa-4626-870f-e3df98ca3d84
2018-01-02 00:00:45 +00:00
initial_state : 'on'
trigger :
- platform : state
entity_id : sensor.carlojuice_charging_status
action :
- service : script.notify_engine
2020-09-26 14:52:45 +00:00
data :
2018-01-02 00:00:45 +00:00
value1 : "The Garage charger is now in {{ states('sensor.carlojuice_charging_status') }} mode."
2020-06-25 20:42:44 +00:00
who : 'parents'
2023-11-17 22:16:41 +00:00
group : 'information'
2018-01-02 00:00:45 +00:00
2018-06-04 19:03:33 +00:00
- alias : 'Juicebox Self-Heal'
2020-07-20 18:33:03 +00:00
id : e693f117-c75d-4bb9-a8f3-c104b226d0c5
2018-06-04 19:03:33 +00:00
initial_state : 'on'
trigger :
- platform : state
entity_id : sensor.carlojuice_charging_status
to : 'disconnect'
2018-06-04 19:35:25 +00:00
for :
2018-06-29 20:11:03 +00:00
minutes : 6
2019-02-23 23:03:43 +00:00
- platform : time_pattern
2018-06-29 20:51:56 +00:00
hours : '/4'
2018-06-04 19:35:25 +00:00
condition :
2018-06-29 20:11:03 +00:00
- condition : state
entity_id : sensor.carlojuice_charging_status
state : 'disconnect'
for :
minutes : 5
2020-09-18 00:09:56 +00:00
2020-09-27 18:09:45 +00:00
- condition : template
value_template : >
2021-11-11 01:57:36 +00:00
{%- if state_attr('automation.juicebox_selfheal', 'last_triggered')-%}
{{ (as_timestamp(now()) - as_timestamp(state_attr('automation.juicebox_selfheal', 'last_triggered'))) > 10000 }}
2020-09-27 18:09:45 +00:00
{%- else -%}
true
{%- endif -%}
2018-06-04 19:03:33 +00:00
action :
- service : homeassistant.turn_on
2023-06-19 20:12:32 +00:00
entity_id : switch.restart_juicebox
2018-06-04 19:03:33 +00:00
2018-01-02 00:00:45 +00:00
- alias : 'JuiceBox AMP Alert!'
2020-07-20 18:33:03 +00:00
id : b805f213-a938-4d90-8d18-e88ff4d41776
2018-01-02 00:00:45 +00:00
initial_state : 'on'
trigger :
- platform : numeric_state
entity_id : sensor.carlojuice_amps
2018-01-07 01:26:30 +00:00
above : 24
for :
minutes : 2
2020-05-29 21:50:36 +00:00
- platform : event
2020-06-25 20:42:44 +00:00
event_type : event_did_someone_help_juicebox_AMPS
condition :
- condition : state
entity_id : sensor.carlojuice_charging_status
state : 'charging'
2018-01-02 00:00:45 +00:00
action :
- service : input_boolean.turn_on
entity_id : input_boolean.alert_mode
- service : script.notify_engine
2020-09-26 14:52:45 +00:00
data :
2018-01-02 00:00:45 +00:00
value1 : "The Juice Box Charger is pulling {{ states('sensor.carlojuice_amps') }} AMPs. This is above the safety mark of 30. Please unplug charger immediately."
who : 'parents'
2023-11-17 22:16:41 +00:00
group : 'JuiceBox'
2018-01-02 00:00:45 +00:00
- service : script.speech_engine
2020-09-26 14:52:45 +00:00
data :
2018-01-02 00:00:45 +00:00
value1 : "The Juice Box Charger is pulling {{ states('sensor.carlojuice_amps') }} AMPs. This is above the safety mark of 30. Please unplug charger immediately."
2020-05-29 21:50:36 +00:00
- delay : 00 : 02 : 00
2020-06-25 20:42:44 +00:00
- event : event_did_someone_help_juicebox_AMPS
- alias : 'JuiceBox Temp Alert!'
2020-07-20 18:33:03 +00:00
id : ddb36236-6ee1-4ba4-8839-661db3658401
2020-06-25 20:42:44 +00:00
initial_state : 'on'
trigger :
- platform : numeric_state
entity_id : sensor.carlojuice_temperature
above : 139
for :
minutes : 2
- platform : event
event_type : event_did_someone_help_juicebox_TEMP
condition :
- condition : state
entity_id : sensor.carlojuice_charging_status
state : 'charging'
action :
- service : input_boolean.turn_on
entity_id : input_boolean.alert_mode
- service : script.notify_engine
2020-09-26 14:52:45 +00:00
data :
2020-06-25 20:42:44 +00:00
value1 : "The Juice Box Charger is running very Hot. Temperature is around {{ states('sensor.carlojuice_temperature') }} degrees. This is above the safety mark of 140. Please unplug the car immediately."
who : 'parents'
2023-11-17 22:16:41 +00:00
group : 'JuiceBox'
2020-06-25 20:42:44 +00:00
- service : script.speech_engine
2020-09-26 14:52:45 +00:00
data :
2020-06-25 20:42:44 +00:00
value1 : "The Juice Box Charger is running very Hot. Temperature is around {{ states('sensor.carlojuice_temperature') }} degrees. This is above the safety mark of 140. Please unplug the car immediately."
- delay : 00 : 02 : 00
- event : event_did_someone_help_juicebox_TEMP