Repository navigation
Expand file tree
/
Copy pathtesla_model_y.yaml
More file actions
1023 lines (980 loc) · 40.8 KB
/
Copy pathtesla_model_y.yaml
File metadata and controls
1023 lines (980 loc) · 40.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
######################################################################
# @CCOSTAN - Follow Me on X
# For more info visit https://www.vcloudinfo.com/click-here
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
# -------------------------------------------------------------------
# Tesla Model Y - Reminders and durable vehicle telemetry
# Related Issue: 1953
# Garage prompts, tire alerts, and last-valid dashboard snapshots.
# -------------------------------------------------------------------
# Related Issue: 1279
# Related Issue: 1666
# Related Issue: 1944
# Notes: Expects Tesla Fleet UI entities `sensor.spaceship_battery_level`
# and `switch.spaceship_charge`.
# Notes: Uses `cover.large_garage_door` closing as the arrival proxy so
# Tesla location drift does not suppress reminders.
# Notes: The nightly parents reminder starts at 8 PM or after a post-8 PM
# garage close, then loops every 30 minutes via a custom event while the
# latest garage-arrival signal is recent and the car still is not charging.
# Notes: Parents push reminders include a 24-hour snooze action.
# Notes: Plug-in reminders only fire when both `person.carlo` and
# `person.stacey` are home.
# Notes: Tire alerts use the four Tesla Fleet PSI sensors, trigger below
# 38.5 PSI, and share a 1-day/3-day snooze with Joanna's morning briefing.
# Notes: Trigger-based snapshot sensors reject unknown/unavailable updates
# and restore useful battery, odometer, location, tire, and JuiceBox values.
# Notes: `event_car_telemetry_snapshot_seed` accepts verified source snapshots;
# live Tesla Fleet and JuiceBox reports remain the normal update path.
# Notes: Snapshot sensors intentionally omit state_class; TeslaMate remains the
# long-term vehicle source while raw JuiceBox energy owns charge statistics.
# Notes: Home charging is intentionally limited to 16 A in the Tesla. Fresh
# actual draw above 18 A requests a native Tesla stop; current limits are unchanged.
# Notes: The 30 A home EVSE circuit's EEPROM-backed offline wire rating was set
# to 24 A during unplugged commissioning. JuicePassProxy is a passive sensor-only
# monitor that sends no charger or former-cloud UDP traffic and exposes no
# limit controls. Transient online/offline max-current fields are ignored.
# Notes: Source verification ignores retained MQTT and cached Tesla timestamps.
# Tesla samples expire after 120 seconds; live JuiceBox reports after 60 seconds.
# Notes: Missing reports dispatch Joanna at three minutes. At five minutes,
# unverified home sessions request a protective stop; verified safe/stopped
# sessions get a quiet monitoring warning only if the outage persists 15 minutes.
# Notes: Stops require home/AC context and fresh post-command zero-current proof.
# The restoring verification timestamp rejects older samples across restarts.
# A restoring review latch blocks home charging resumption until manually cleared.
# No automatic start commands are issued. Tagged incident pushes clear only after
# their own recovery checks. Older untagged alerts require dismissal on the phone.
# Notes: Portainer state remains diagnostic and cannot by itself mark the
# charger monitor offline.
# Notes: The visited-map camera uses a private daily Grafana PNG. An hourly
# command checks the cache; the first check after 06:00 refreshes it.
# Failed renders retain the previous image and retry at the next check.
# Tire-pressure video: https://youtu.be/hDNyZfTfTtE
# Tire-pressure post: https://www.vcloudinfo.com/2026/09/home-assistant-tesla-tire-pressure-alerts.html
# Related garage video: https://youtu.be/wFO0H5zgnzk
# Related garage post: https://www.vcloudinfo.com/2026/05/home-assistant-garage-automations-arrival-alerts-tesla.html
######################################################################
command_line:
- sensor:
name: Tesla Visited Map Updated
unique_id: tesla_visited_map_updated
command: "python3 /config/shell_scripts/teslamate_visited_snapshot.py"
scan_interval: 3600
command_timeout: 180
device_class: timestamp
value_template: "{{ value_json.updated_at }}"
availability: "{{ value_json.updated_at is not none }}"
json_attributes:
- last_error
- stale
input_boolean:
tesla_high_charge_rate_alert_active:
name: Tesla Home Charging Incident Active
icon: mdi:car-electric-outline
tesla_home_charge_restart_required:
name: Tesla Home Charging Restart Review Required
icon: mdi:car-electric-outline
tesla_home_charge_session_active:
name: Tesla Home Charging Session Active
icon: mdi:ev-plug-type1
tesla_charge_guard:
entity_id: sensor.spaceship_charger_current
mqtt_prefix: hmd/sensor/JuiceBox
current_limit: 18
mqtt:
sensor:
- name: "JuicePassProxy MQTT Heartbeat"
unique_id: juicepassproxy_mqtt_heartbeat
state_topic: "hmd/sensor/JuiceBox/Frequency/state"
value_template: "{{ 'online' }}"
expire_after: 60
icon: mdi:heart-pulse
input_datetime:
tesla_home_charge_verify_after:
name: Tesla Home Charge Verify After
has_date: true
has_time: true
tesla_model_y_last_garage_close:
name: Tesla Model Y Last Garage Close
has_date: true
has_time: true
tesla_model_y_plug_in_snooze_until:
name: Tesla Model Y Plug In Snooze Until
has_date: true
has_time: true
tesla_tire_pressure_snooze_until:
name: Tesla Tire Pressure Snooze Until
has_date: true
has_time: true
template:
- binary_sensor:
- name: "JuicePassProxy Live Reports Missing"
unique_id: juicepassproxy_live_reports_missing
state: >-
{{ not is_state('sensor.juicepassproxy_mqtt_heartbeat', 'online')
or (state_attr('sensor.tesla_home_charge_guard', 'mqtt_observation_ready') == true
and state_attr('sensor.tesla_home_charge_guard', 'juicebox_fresh') == false) }}
- name: "JuicePassProxy Investigation Needed"
unique_id: juicepassproxy_investigation_needed
device_class: problem
delay_on: "00:02:00"
state: "{{ is_state('binary_sensor.juicepassproxy_live_reports_missing', 'on') }}"
- name: "JuicePassProxy Monitoring Degraded"
unique_id: juicepassproxy_monitoring_degraded
device_class: problem
delay_on: "00:04:00"
state: "{{ is_state('binary_sensor.juicepassproxy_live_reports_missing', 'on') }}"
attributes:
mqtt_heartbeat: "{{ states('sensor.juicepassproxy_mqtt_heartbeat') }}"
source_state: "{{ states('sensor.juicepassproxy_state') }}"
source_health: "{{ states('sensor.juicepassproxy_health') }}"
guidance: "{{ state_attr('sensor.tesla_home_charge_guard', 'reason') }}"
- name: "JuicePassProxy Monitoring Persistent"
unique_id: juicepassproxy_monitoring_persistent
device_class: problem
delay_on: "00:14:00"
state: "{{ is_state('binary_sensor.juicepassproxy_live_reports_missing', 'on') }}"
- name: "Tesla Home Charge Stop Verified"
unique_id: tesla_home_charge_stop_verified
state: >-
{% set sample = state_attr('sensor.tesla_home_charge_guard', 'sample_time') | float(0) %}
{% set boundary = state_attr('input_datetime.tesla_home_charge_verify_after', 'timestamp') | float(0) %}
{{ is_state('input_boolean.tesla_high_charge_rate_alert_active', 'on')
and is_state('sensor.tesla_home_charge_guard', 'stopped')
and sample > boundary and -5 <= as_timestamp(now()) - sample <= 60 }}
- name: "Tesla Home Charge Critical"
unique_id: tesla_home_charge_critical
device_class: problem
state: >-
{{ is_state('sensor.tesla_home_charge_guard', 'excessive')
or is_state('input_boolean.tesla_high_charge_rate_alert_active', 'on')
or (is_state('binary_sensor.juicepassproxy_monitoring_degraded', 'on')
and is_state('sensor.tesla_home_charge_guard', 'unverified')
and state_attr('sensor.tesla_home_charge_guard', 'home_session') == true) }}
- name: "Tesla Home Charge Attention"
unique_id: tesla_home_charge_attention
device_class: problem
state: >-
{{ is_state('binary_sensor.juicepassproxy_monitoring_degraded', 'on')
or is_state('binary_sensor.tesla_home_charge_critical', 'on')
or is_state('input_boolean.tesla_home_charge_restart_required', 'on') }}
- triggers:
- trigger: event
event_type: tesla_charge_guard_report
sensor:
- name: "Tesla Home Charge Guard"
unique_id: tesla_home_charge_guard
icon: mdi:shield-car
state: "{{ trigger.event.data.status }}"
attributes:
actual_current: "{{ trigger.event.data.actual_current }}"
source: "{{ trigger.event.data.source }}"
sample_time: "{{ trigger.event.data.sample_time }}"
checked_at: "{{ trigger.event.data.checked_at }}"
tesla_fresh: "{{ trigger.event.data.tesla_fresh }}"
juicebox_fresh: "{{ trigger.event.data.juicebox_fresh }}"
mqtt_observation_ready: "{{ trigger.event.data.mqtt_observation_ready }}"
home_session: "{{ trigger.event.data.home_session }}"
session_observed: "{{ trigger.event.data.session_observed }}"
stop_allowed: "{{ trigger.event.data.stop_allowed }}"
reason: "{{ trigger.event.data.reason }}"
- triggers:
- trigger: state
entity_id:
- sensor.spaceship_battery_level
- sensor.odometer
- device_tracker.spaceship_location
- sensor.spaceship_charging
- binary_sensor.spaceship_charge_cable
- sensor.tire_pressure_front_left
- sensor.tire_pressure_front_right
- sensor.tire_pressure_rear_left
- sensor.tire_pressure_rear_right
- sensor.juicebox_status
- sensor.juicebox_current
- sensor.juicebox_current_rating
- sensor.juicebox_frequency
- sensor.juicebox_energy_lifetime
- sensor.juicebox_energy_session
- sensor.juicebox_temperature
- sensor.juicebox_voltage
- sensor.juicebox_power
- sensor.juicebox_power_factor
not_to:
- "unknown"
- "unavailable"
- trigger: event
event_type: event_car_telemetry_snapshot_seed
variables:
snapshot_source_entity: >-
{% if trigger.platform == 'event' %}
{{ trigger.event.data.entity_id | default('', true) }}
{% else %}
{{ trigger.entity_id }}
{% endif %}
snapshot_state: >-
{% if trigger.platform == 'event' %}
{{ trigger.event.data.state | default(none) }}
{% else %}
{{ trigger.to_state.state }}
{% endif %}
sensor:
- name: "Car Battery Last Known"
unique_id: car_battery_last_known
device_class: battery
unit_of_measurement: "%"
conditions:
- "{{ snapshot_source_entity == 'sensor.spaceship_battery_level' }}"
state: "{{ snapshot_state }}"
- name: "Car Odometer Last Known"
unique_id: car_odometer_last_known
device_class: distance
unit_of_measurement: "mi"
conditions:
- "{{ snapshot_source_entity == 'sensor.odometer' }}"
state: "{{ snapshot_state }}"
- name: "Car Location Last Known"
unique_id: car_location_last_known
conditions:
- "{{ snapshot_source_entity == 'device_tracker.spaceship_location' }}"
state: "{{ snapshot_state }}"
- name: "Car Charging Last Known"
unique_id: car_charging_last_known
conditions:
- "{{ snapshot_source_entity == 'sensor.spaceship_charging' }}"
state: "{{ snapshot_state }}"
- name: "Car Charge Cable Last Known"
unique_id: car_charge_cable_last_known
conditions:
- "{{ snapshot_source_entity == 'binary_sensor.spaceship_charge_cable' }}"
state: "{{ snapshot_state }}"
- name: "Car Tire Pressure Front Left Last Known"
unique_id: car_tire_pressure_front_left_last_known
device_class: pressure
unit_of_measurement: "psi"
conditions:
- "{{ snapshot_source_entity == 'sensor.tire_pressure_front_left' }}"
state: "{{ snapshot_state }}"
- name: "Car Tire Pressure Front Right Last Known"
unique_id: car_tire_pressure_front_right_last_known
device_class: pressure
unit_of_measurement: "psi"
conditions:
- "{{ snapshot_source_entity == 'sensor.tire_pressure_front_right' }}"
state: "{{ snapshot_state }}"
- name: "Car Tire Pressure Rear Left Last Known"
unique_id: car_tire_pressure_rear_left_last_known
device_class: pressure
unit_of_measurement: "psi"
conditions:
- "{{ snapshot_source_entity == 'sensor.tire_pressure_rear_left' }}"
state: "{{ snapshot_state }}"
- name: "Car Tire Pressure Rear Right Last Known"
unique_id: car_tire_pressure_rear_right_last_known
device_class: pressure
unit_of_measurement: "psi"
conditions:
- "{{ snapshot_source_entity == 'sensor.tire_pressure_rear_right' }}"
state: "{{ snapshot_state }}"
- name: "JuiceBox Status Last Known"
unique_id: juicebox_status_last_known
conditions:
- "{{ snapshot_source_entity == 'sensor.juicebox_status' }}"
state: "{{ snapshot_state }}"
- name: "JuiceBox Current Last Known"
unique_id: juicebox_current_last_known
device_class: current
unit_of_measurement: "A"
conditions:
- "{{ snapshot_source_entity == 'sensor.juicebox_current' }}"
state: "{{ snapshot_state }}"
- name: "JuiceBox Current Rating Last Known"
unique_id: juicebox_current_rating_last_known
device_class: current
unit_of_measurement: "A"
conditions:
- "{{ snapshot_source_entity == 'sensor.juicebox_current_rating' }}"
state: "{{ snapshot_state }}"
- name: "JuiceBox Frequency Last Known"
unique_id: juicebox_frequency_last_known
device_class: frequency
unit_of_measurement: "Hz"
conditions:
- "{{ snapshot_source_entity == 'sensor.juicebox_frequency' }}"
state: "{{ snapshot_state }}"
- name: "JuiceBox Lifetime Energy Last Known"
unique_id: juicebox_lifetime_energy_last_known
device_class: energy
unit_of_measurement: "Wh"
conditions:
- "{{ snapshot_source_entity == 'sensor.juicebox_energy_lifetime' }}"
state: "{{ snapshot_state }}"
- name: "JuiceBox Session Energy Last Known"
unique_id: juicebox_session_energy_last_known
device_class: energy
unit_of_measurement: "Wh"
conditions:
- "{{ snapshot_source_entity == 'sensor.juicebox_energy_session' }}"
state: "{{ snapshot_state }}"
- name: "JuiceBox Temperature Last Known"
unique_id: juicebox_temperature_last_known
device_class: temperature
unit_of_measurement: "\u00b0F"
conditions:
- "{{ snapshot_source_entity == 'sensor.juicebox_temperature' }}"
state: "{{ snapshot_state }}"
- name: "JuiceBox Voltage Last Known"
unique_id: juicebox_voltage_last_known
device_class: voltage
unit_of_measurement: "V"
conditions:
- "{{ snapshot_source_entity == 'sensor.juicebox_voltage' }}"
state: "{{ snapshot_state }}"
- name: "JuiceBox Power Last Known"
unique_id: juicebox_power_last_known
device_class: power
unit_of_measurement: "W"
conditions:
- "{{ snapshot_source_entity == 'sensor.juicebox_power' }}"
state: "{{ snapshot_state }}"
- name: "JuiceBox Power Factor Last Known"
unique_id: juicebox_power_factor_last_known
device_class: power_factor
conditions:
- "{{ snapshot_source_entity == 'sensor.juicebox_power_factor' }}"
state: "{{ snapshot_state }}"
script:
tesla_home_charge_dispatch:
alias: Tesla Home Charge - Joanna Investigation
mode: queued
max: 3
fields:
summary:
description: Verified incident summary
request:
description: Investigation scope
sequence:
- service: script.joanna_dispatch
data:
trigger_context: "HA Tesla home charging protection"
source: "home_assistant_automation.juicepassproxy_monitoring_alert"
summary: "{{ summary }}"
entity_ids:
- sensor.tesla_home_charge_guard
- sensor.juicepassproxy_mqtt_heartbeat
- binary_sensor.tesla_home_charge_critical
- sensor.juicepassproxy_state
- sensor.juicepassproxy_health
- sensor.spaceship_charger_current
- sensor.spaceship_charging
- switch.spaceship_charge
- input_boolean.tesla_home_charge_restart_required
diagnostics: >-
assessment={{ states('sensor.tesla_home_charge_guard') }},
actual_current={{ state_attr('sensor.tesla_home_charge_guard', 'actual_current') }},
source={{ state_attr('sensor.tesla_home_charge_guard', 'source') }},
sample_time={{ state_attr('sensor.tesla_home_charge_guard', 'sample_time') }},
home_session={{ state_attr('sensor.tesla_home_charge_guard', 'home_session') }},
mqtt_heartbeat={{ states('sensor.juicepassproxy_mqtt_heartbeat') }}
request: "{{ request }}"
tesla_home_charge_protect:
alias: Tesla Home Charge - Protective Stop
mode: single
max_exceeded: silent
fields:
reason:
description: Why home charging needs to be paused
sequence:
- service: tesla_charge_guard.snapshot
data:
refresh: true
response_variable: guard
- condition: template
value_template: >-
{{ guard.status == 'excessive'
or (guard.status == 'unverified' and guard.home_session)
or (guard.status == 'charging_safe'
and is_state('input_boolean.tesla_home_charge_restart_required', 'on')) }}
- variables:
verification_after: >-
{% set requested = as_timestamp(now()) %}
{{ [requested, guard.tesla_sample_time | float(0), guard.juicebox_sample_time | float(0)]
| select('le', requested + 5) | max | round(0, 'ceil') | int }}
incident_reason: "{{ reason | default(guard.reason, true) }}"
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.tesla_home_charge_verify_after
data:
timestamp: "{{ verification_after }}"
- service: input_boolean.turn_on
target:
entity_id:
- input_boolean.tesla_high_charge_rate_alert_active
- input_boolean.tesla_home_charge_restart_required
- parallel:
- sequence:
- condition: template
value_template: "{{ guard.stop_allowed }}"
- service: switch.turn_off
continue_on_error: true
target:
entity_id: switch.spaceship_charge
- service: script.notify_engine
continue_on_error: true
data:
title: "URGENT: Tesla Home Charging"
value1: >-
{{ incident_reason }}
{{ 'A Tesla stop was requested; verification is pending.' if guard.stop_allowed
else 'A vehicle stop is blocked because home AC charging cannot be established. Check the charger.' }}
who: parents
group: Tesla_Charge_Rate_Alarm
tag: Tesla_Charge_Rate_Alarm
level: critical
- service: notify.alexa_media_garage
continue_on_error: true
data:
message: >-
Warning. {{ incident_reason }}
{{ 'A charging stop was requested. Check the Tesla if charging continues.' if guard.stop_allowed
else 'Check the charger. The vehicle location could not be verified for a stop.' }}
data:
type: announce
- service: script.tesla_home_charge_dispatch
continue_on_error: true
data:
summary: "{{ incident_reason }}"
request: >-
Home Assistant owns the protective stop and restart-review latch.
Verify fresh actual-current reports and the owning monitoring path.
Repair monitoring when safe; check for an active deployment before
restarting a container. Do not change current limits, charging helpers,
or the verification timestamp, or start charging. Report verified results
and any stop failure.
- repeat:
count: 2
sequence:
- if:
- condition: template
value_template: >-
{{ not is_state('binary_sensor.tesla_home_charge_stop_verified', 'on') }}
then:
- delay: "00:00:05"
- service: tesla_charge_guard.snapshot
continue_on_error: true
data:
refresh: true
response_variable: verification
- wait_template: >-
{{ is_state('binary_sensor.tesla_home_charge_stop_verified', 'on') }}
timeout: "00:00:25"
continue_on_timeout: true
- if:
- condition: template
value_template: >-
{{ not wait.completed and repeat.index == 1
and state_attr('sensor.tesla_home_charge_guard', 'stop_allowed') == true }}
then:
- service: switch.turn_off
continue_on_error: true
target:
entity_id: switch.spaceship_charge
- variables:
stop_verified: >-
{{ is_state('binary_sensor.tesla_home_charge_stop_verified', 'on') }}
- if:
- condition: template
value_template: "{{ not stop_verified }}"
then:
- service: script.notify_engine
continue_on_error: true
data:
title: "URGENT: Tesla Stop Unverified"
value1: >-
{{ incident_reason }} Fresh zero-current confirmation did not arrive.
Check the Tesla and unplug it if charging continues. Home charging
requires your review before resuming.
who: parents
group: Tesla_Charge_Rate_Alarm
tag: Tesla_Charge_Rate_Alarm
level: critical
- service: script.send_to_logbook
data:
topic: JUICEBOX
message: >-
{{ incident_reason }} Stop {{ 'verified by a fresh zero-current report' if stop_verified else 'unverified after bounded attempts' }}.
Home charging restart review remains required; no start command was issued.
automation:
- alias: "Tesla Model Y - Refresh Home Charge Verification"
id: 7602df3d-20b6-448d-bbcd-b00a774e6dd9
mode: single
max_exceeded: silent
trigger:
- platform: homeassistant
event: start
id: startup
- platform: time_pattern
minutes: "/1"
id: periodic
- platform: state
entity_id:
- sensor.spaceship_charger_current
- sensor.spaceship_charging
- device_tracker.spaceship_location
- input_boolean.tesla_home_charge_restart_required
id: vehicle
action:
- service: tesla_charge_guard.snapshot
continue_on_error: true
data:
refresh: >-
{{ trigger.id == 'periodic'
and (is_state('binary_sensor.juicepassproxy_investigation_needed', 'on')
or (is_state('sensor.tesla_home_charge_guard', 'unverified')
and state_attr('sensor.tesla_home_charge_guard', 'juicebox_fresh') == true)) }}
- alias: "Tesla Model Y - High Home Charge Rate Alert"
id: f4f013f9-74e7-492e-8400-ae84897086ef
mode: queued
max: 5
max_exceeded: silent
trigger:
- platform: event
event_type: tesla_charge_guard_report
action:
- if:
- condition: template
value_template: >-
{{ trigger.event.data.session_observed is not none
and is_state('input_boolean.tesla_home_charge_session_active', 'on') != trigger.event.data.session_observed }}
then:
- service: >-
{{ 'input_boolean.turn_on' if trigger.event.data.session_observed else 'input_boolean.turn_off' }}
target:
entity_id: input_boolean.tesla_home_charge_session_active
- if:
- condition: state
entity_id: input_boolean.tesla_high_charge_rate_alert_active
state: 'off'
- condition: template
value_template: >-
{{ trigger.event.data.status == 'excessive'
or (trigger.event.data.status == 'charging_safe'
and is_state('input_boolean.tesla_home_charge_restart_required', 'on')) }}
then:
- service: script.turn_on
target:
entity_id: script.tesla_home_charge_protect
data:
variables:
reason: >-
{{ 'Home charging resumed while restart review was still required.' if trigger.event.data.status == 'charging_safe'
else 'Fresh home charging draw is ' ~ trigger.event.data.actual_current ~ ' A, above the 18 A guardrail.' }}
- alias: "Tesla Model Y - Reset High Charge Rate Alert"
id: ccb67406-4ac1-41de-8f47-a3a76e6d8762
mode: queued
max: 3
trigger:
- platform: state
entity_id: binary_sensor.tesla_home_charge_stop_verified
to: 'on'
- platform: state
entity_id: script.tesla_home_charge_protect
to: 'off'
condition:
- condition: state
entity_id: input_boolean.tesla_high_charge_rate_alert_active
state: 'on'
- condition: state
entity_id: script.tesla_home_charge_protect
state: 'off'
- condition: state
entity_id: binary_sensor.tesla_home_charge_stop_verified
state: 'on'
action:
- service: input_boolean.turn_off
target:
entity_id: input_boolean.tesla_high_charge_rate_alert_active
- service: notify.ios_parents
continue_on_error: true
data:
message: clear_notification
data:
tag: Tesla_Charge_Rate_Alarm
- service: script.send_to_logbook
data:
topic: JUICEBOX
message: >-
Fresh post-incident zero current verified; the critical charging incident
cleared. Restart review stays enabled until a person clears it.
- alias: "Tesla Model Y - JuicePassProxy Monitoring Alert"
id: e4b6bf07-4760-4e7c-b2da-6db234a46df8
mode: queued
max: 5
trigger:
- platform: state
entity_id: binary_sensor.juicepassproxy_investigation_needed
to: 'on'
id: investigate
- platform: state
entity_id: binary_sensor.juicepassproxy_monitoring_degraded
to: 'on'
id: assess
- platform: state
entity_id: binary_sensor.tesla_home_charge_critical
to: 'on'
id: risk
- platform: state
entity_id: binary_sensor.juicepassproxy_monitoring_persistent
to: 'on'
id: persistent
- platform: state
entity_id: sensor.juicepassproxy_mqtt_heartbeat
to: online
id: restored
- platform: state
entity_id: sensor.tesla_home_charge_guard
attribute: juicebox_fresh
to: true
id: restored
action:
- choose:
- conditions:
- condition: trigger
id: investigate
- condition: state
entity_id: binary_sensor.juicepassproxy_investigation_needed
state: 'on'
sequence:
- service: tesla_charge_guard.snapshot
continue_on_error: true
data:
refresh: true
- service: script.tesla_home_charge_dispatch
continue_on_error: true
data:
summary: "Live JuiceBox charging reports are missing or incomplete"
request: >-
Verify the owning JuicePassProxy container and recent live MQTT
reports. Restore the failed path when safe; check for an active
deployment before restarting a container. Home Assistant owns
charging protection. Do not change limits, start charging, or
clear the restart-review latch. Report verified recovery.
- service: script.send_to_logbook
data:
topic: JUICEBOX
message: "Missing reports for three minutes; Joanna dispatched with source verification."
- conditions:
- condition: trigger
id:
- assess
- risk
- condition: state
entity_id: binary_sensor.juicepassproxy_monitoring_degraded
state: 'on'
- condition: state
entity_id: input_boolean.tesla_high_charge_rate_alert_active
state: 'off'
sequence:
- service: tesla_charge_guard.snapshot
data:
refresh: true
response_variable: guard
- if:
- condition: template
value_template: "{{ guard.status == 'unverified' and guard.home_session }}"
then:
- service: script.tesla_home_charge_protect
data:
reason: "Both charging sources are unverified during a home charging session after the five-minute monitoring assessment."
else:
- service: script.send_to_logbook
data:
topic: JUICEBOX
message: >-
Five-minute monitoring assessment: {{ guard.status }}.
No charging critical alert was sent; persistent monitoring
faults receive a quiet warning at 15 minutes.
- conditions:
- condition: trigger
id: persistent
- condition: state
entity_id: binary_sensor.juicepassproxy_monitoring_persistent
state: 'on'
- condition: state
entity_id: binary_sensor.tesla_home_charge_critical
state: 'off'
sequence:
- service: script.notify_engine
continue_on_error: true
data:
title: JuiceBox Monitoring Needs Review
value1: >-
JuiceBox reports have been missing or incomplete for 15 minutes. Joanna was
dispatched. Charging assessment: {{ states('sensor.tesla_home_charge_guard') }}.
who: parents
group: JuiceBox_Proxy_Offline
tag: JuiceBox_Proxy_Offline
level: passive
- conditions:
- condition: trigger
id: restored
- condition: state
entity_id: sensor.juicepassproxy_mqtt_heartbeat
state: online
- condition: template
value_template: "{{ state_attr('sensor.tesla_home_charge_guard', 'juicebox_fresh') == true }}"
sequence:
- service: notify.ios_parents
continue_on_error: true
data:
message: clear_notification
data:
tag: JuiceBox_Proxy_Offline
- service: script.send_to_logbook
data:
topic: JUICEBOX
message: "Live JuiceBox reports verified; matching monitoring notification cleared."
- alias: "Tesla Model Y - Plug In Reminder"
id: 6a873341-c823-4d5d-9d42-fc2df52b93db
mode: restart
trigger:
- platform: time
at: '20:00:00'
id: nightly
- platform: event
event_type: event_tesla_model_y_nightly_loop
id: loop
- platform: time
at: input_datetime.tesla_model_y_plug_in_snooze_until
id: snooze_expired
- platform: state
entity_id: cover.large_garage_door
from: 'open'
to: 'closed'
for: '00:03:20'
id: garage_closed
action:
- choose:
- conditions:
- condition: trigger
id: garage_closed
sequence:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.tesla_model_y_last_garage_close
data:
datetime: "{{ now().strftime('%Y-%m-%d %H:%M:%S') }}"
- condition: or
conditions:
- condition: trigger
id: garage_closed
- condition: template
value_template: >-
{% set last_close_ts = as_timestamp(states('input_datetime.tesla_model_y_last_garage_close'), 0) %}
{{ last_close_ts > 0 and (as_timestamp(now()) - last_close_ts) < 43200 }}
- condition: numeric_state
entity_id: sensor.spaceship_battery_level
below: 50
- condition: state
entity_id: person.carlo
state: 'home'
- condition: state
entity_id: person.stacey
state: 'home'
- condition: state
entity_id: switch.spaceship_charge
state: 'off'
- condition: template
value_template: >-
{% set snooze_until = as_timestamp(states('input_datetime.tesla_model_y_plug_in_snooze_until'), 0) %}
{{ snooze_until <= as_timestamp(now()) }}
- choose:
- conditions:
- condition: trigger
id: garage_closed
sequence:
- service: notify.alexa_media_garage
data:
message: >-
Reminder: the Tesla battery is at
{{ states('sensor.spaceship_battery_level') | float(0) | round(0) }} percent.
Please plug in the Model Y.
data:
type: announce
- service: script.send_to_logbook
data:
topic: "TESLA"
message: >-
Garage reminder announced to plug in the Model Y at
{{ states('sensor.spaceship_battery_level') | float(0) | round(0) }} percent.
- condition: or
conditions:
- condition: not
conditions:
- condition: trigger
id: garage_closed
- condition: time
after: '20:00:00'
before: '05:00:00'
- service: script.notify_engine_two_button
data:
title: "Tesla Plug In Reminder"
value1: >-
The Model Y recently came in through the garage, is below 50 percent,
and is not plugged in.
Current battery:
{{ states('sensor.spaceship_battery_level') | float(0) | round(0) }} percent.
who: 'parents'
group: 'Tesla_Model_Y'
title1: "Snooze 24h"
action1: "SNOOZE_TESLA_PLUG_IN_24H"
icon1: "sfsymbols:clock"
- service: script.send_to_logbook
data:
topic: "TESLA"
message: >-
Nightly plug-in reminder sent because the Model Y recently came in through the garage below 50 percent and is not charging.
- delay: '00:30:00'
- event: event_tesla_model_y_nightly_loop
- alias: "Tesla Model Y - Plug In Reminder Snooze"
id: 5b7b9b93-1f12-4c5e-9bc4-95c8cb1a104f
mode: queued
trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: SNOOZE_TESLA_PLUG_IN_24H
variables:
snooze_until: "{{ (now() + timedelta(hours=24)).strftime('%Y-%m-%d %H:%M:%S') }}"
action:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.tesla_model_y_plug_in_snooze_until
data:
datetime: "{{ snooze_until }}"
- service: script.send_to_logbook
data:
topic: "TESLA"
message: "Tesla plug-in reminders snoozed for 24 hours (until {{ snooze_until }})."
- alias: "Tesla Model Y - Low Tire Pressure Alert"
id: 99e546aa-a6c0-4154-9c30-f901f81d1b40
mode: restart
trigger:
- platform: numeric_state
entity_id:
- sensor.tire_pressure_front_left
- sensor.tire_pressure_front_right
- sensor.tire_pressure_rear_left
- sensor.tire_pressure_rear_right
below: 38.5
id: pressure_low
- platform: time
at: input_datetime.tesla_tire_pressure_snooze_until
id: snooze_expired
action:
- delay: '00:00:10'
- condition: or
conditions:
- condition: numeric_state
entity_id: sensor.tire_pressure_front_left
below: 38.5
- condition: numeric_state
entity_id: sensor.tire_pressure_front_right
below: 38.5
- condition: numeric_state
entity_id: sensor.tire_pressure_rear_left
below: 38.5
- condition: numeric_state
entity_id: sensor.tire_pressure_rear_right
below: 38.5
- condition: template
value_template: >-
{% set snooze_until = as_timestamp(states('input_datetime.tesla_tire_pressure_snooze_until'), 0) %}
{{ snooze_until <= as_timestamp(now()) }}
- variables:
low_tires: >-
{% from 'tesla_tires.jinja' import low_tires %}
{{ low_tires() }}
- service: script.notify_engine_two_button
data:
title: "Tesla Tire Pressure"
value1: >-
{{ low_tires }}. Fill any Tesla tire below 38.5 PSI.
who: 'parents'
group: 'Tesla_Tire_Pressure'
title1: "Snooze 1d"
action1: "SNOOZE_TESLA_TIRE_PRESSURE_1D"
icon1: "sfsymbols:clock"
title2: "Snooze 3d"
action2: "SNOOZE_TESLA_TIRE_PRESSURE_3D"
icon2: "sfsymbols:calendar"
- service: script.send_to_logbook
data:
topic: "TESLA"
message: "Low tire pressure alert sent: {{ low_tires }}."
- alias: "Tesla Model Y - Tire Pressure Snooze"
id: 59da708d-be6f-422a-9478-090cb5087524
mode: queued
trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: SNOOZE_TESLA_TIRE_PRESSURE_1D
id: one_day
- platform: event
event_type: mobile_app_notification_action
event_data:
action: SNOOZE_TESLA_TIRE_PRESSURE_3D
id: three_days
variables:
snooze_days: "{{ 1 if trigger.id == 'one_day' else 3 }}"
snooze_until: "{{ (now() + timedelta(days=snooze_days | int)).strftime('%Y-%m-%d %H:%M:%S') }}"
snooze_label: "{{ '1 day' if trigger.id == 'one_day' else '3 days' }}"
action:
- service: input_datetime.set_datetime
target:
entity_id: input_datetime.tesla_tire_pressure_snooze_until
data:
datetime: "{{ snooze_until }}"
- service: script.send_to_logbook
data:
topic: "TESLA"
message: "Tesla tire pressure alert snoozed for {{ snooze_label }} (until {{ snooze_until }})."
- alias: "Tesla Model Y - Clear Tire Pressure Snooze"
id: 5c4c6362-0123-4360-ade1-beae49241165
mode: single
trigger:
- platform: numeric_state
entity_id:
- sensor.tire_pressure_front_left
- sensor.tire_pressure_front_right
- sensor.tire_pressure_rear_left
- sensor.tire_pressure_rear_right
above: 38.499
condition:
- condition: numeric_state
entity_id: sensor.tire_pressure_front_left
above: 38.499