Skip to content

Commit 347d626

Browse files
committed
Update Home Assistant agent instructions
1 parent 8e9ea09 commit 347d626

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

config/packages/stats.yaml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
55
# -------------------------------------------------------------------
66
# Stats - Historical metrics and AI notifications.
7+
# Related Issue: 1279
78
# Build historical stats for AI/alerting.
89
# -------------------------------------------------------------------
9-
# Contact: @CCOSTAN
1010
# Notes: Numeric repo and home counters expose state_class for long-term trend rollups.
11+
# Notes: Tesla charging time now normalizes Tesla Fleet charging state instead of the retired JuiceBox API.
1112
######################################################################
1213

1314
### Building out some Historical stats for AI. #####################
@@ -69,8 +70,8 @@ sensor:
6970

7071
- platform: history_stats
7172
name: Tesla Charging time
72-
entity_id: sensor.carlojuice_charging_status
73-
state: 'charging'
73+
entity_id: binary_sensor.tesla_charging_active
74+
state: 'on'
7475
type: time
7576
end: '{{ now() }}'
7677
duration:
@@ -79,6 +80,17 @@ sensor:
7980
### Building some interesting stats for tweeting. ###
8081

8182
template:
83+
- binary_sensor:
84+
- name: "Tesla Charging Active"
85+
unique_id: stats_tesla_charging_active
86+
icon: mdi:ev-station
87+
availability: >-
88+
{{ states('sensor.spaceship_charging') not in ['unknown', 'unavailable', 'none', ''] or
89+
states('switch.spaceship_charge') not in ['unknown', 'unavailable', 'none', ''] }}
90+
state: >-
91+
{{ states('sensor.spaceship_charging') | lower == 'charging' or
92+
is_state('switch.spaceship_charge', 'on') }}
93+
8294
- sensor:
8395
- name: "Number of Sensors"
8496
unique_id: stats_number_of_sensors

0 commit comments

Comments
 (0)