|
|
|
|
@ -8,7 +8,7 @@
|
|
|
|
|
# Build historical stats for AI/alerting.
|
|
|
|
|
# -------------------------------------------------------------------
|
|
|
|
|
# Notes: Numeric repo and home counters expose state_class for long-term trend rollups.
|
|
|
|
|
# Notes: Tesla charging time now normalizes Tesla Fleet charging state instead of the retired JuiceBox API.
|
|
|
|
|
# Notes: Tesla charging-duration history lives in TeslaMate instead of HA recorder.
|
|
|
|
|
######################################################################
|
|
|
|
|
|
|
|
|
|
### Building out some Historical stats for AI. #####################
|
|
|
|
|
@ -68,29 +68,9 @@ sensor:
|
|
|
|
|
duration:
|
|
|
|
|
hours: 24
|
|
|
|
|
|
|
|
|
|
- platform: history_stats
|
|
|
|
|
name: Tesla Charging time
|
|
|
|
|
entity_id: binary_sensor.tesla_charging_active
|
|
|
|
|
state: 'on'
|
|
|
|
|
type: time
|
|
|
|
|
end: '{{ now() }}'
|
|
|
|
|
duration:
|
|
|
|
|
days: 7
|
|
|
|
|
|
|
|
|
|
### Building some interesting stats for tweeting. ###
|
|
|
|
|
|
|
|
|
|
template:
|
|
|
|
|
- binary_sensor:
|
|
|
|
|
- name: "Tesla Charging Active"
|
|
|
|
|
unique_id: stats_tesla_charging_active
|
|
|
|
|
icon: mdi:ev-station
|
|
|
|
|
availability: >-
|
|
|
|
|
{{ states('sensor.spaceship_charging') not in ['unknown', 'unavailable', 'none', ''] or
|
|
|
|
|
states('switch.spaceship_charge') not in ['unknown', 'unavailable', 'none', ''] }}
|
|
|
|
|
state: >-
|
|
|
|
|
{{ states('sensor.spaceship_charging') | lower == 'charging' or
|
|
|
|
|
is_state('switch.spaceship_charge', 'on') }}
|
|
|
|
|
|
|
|
|
|
- sensor:
|
|
|
|
|
- name: "Number of Sensors"
|
|
|
|
|
unique_id: stats_number_of_sensors
|
|
|
|
|
|