This repository has been archived by the owner on Apr 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
leaf-sensors.yaml
82 lines (68 loc) · 2.2 KB
/
leaf-sensors.yaml
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
- platform: mqtt
name: "LEAF monthly trips"
state_topic: "leaf/MY_VIN/tripsNumber"
- platform: mqtt
name: "LEAF monthly travel time"
state_topic: "leaf/MY_VIN/traveltime"
value_template: >-
{% set vl = value.split(":") %}
{{ timedelta(0,(vl[0])|int*3600 + (vl[1])|int*60) }}
- platform: mqtt
name: "LEAF charge time 6kW"
state_topic: "leaf/MY_VIN/time6kW"
value_template: >-
{% set vl = value.split(":") %}
{{ (timedelta(0,(vl[0])|int*3600 + (vl[1])|int*60)|string)[:-3] }}
- platform: mqtt
name: "LEAF battery percentage"
state_topic: "leaf/MY_VIN/battpct"
value_template: "{{ value.replace('%', '') }}"
device_class: battery
unit_of_measurement: "%"
- platform: mqtt
name: LEAF GOM
state_topic: "leaf/MY_VIN/GOM"
value_template: "{{ value.replace(' mi', '') }}"
unit_of_measurement: "mi"
- platform: mqtt
name: LEAF cabin temperature
state_topic: "leaf/MY_VIN/cabintemp"
device_class: temperature
unit_of_measurement: "°C"
- platform: mqtt
name: LEAF miles this month
state_topic: "leaf/MY_VIN/distance"
value_template: "{{ value.replace(' mi', '') }}"
unit_of_measurement: "mi"
- platform: mqtt
name: LEAF average speed this month
state_topic: "leaf/MY_VIN/avspeed"
value_template: "{{ value.replace(' mph', '') }}"
unit_of_measurement: "mph"
- platform: mqtt
name: LEAF consumption this month
state_topic: "leaf/MY_VIN/kWhconsumed"
value_template: "{{ value.replace(' kWh', '') }}"
unit_of_measurement: "kWh"
device_class: energy
- platform: mqtt
name: LEAF regen this month
state_topic: "leaf/MY_VIN/kWhregen"
value_template: "{{ value.replace(' kWh', '') }}"
unit_of_measurement: "kWh"
device_class: energy
- platform: mqtt
name: LEAF efficiency this month
state_topic: "leaf/MY_VIN/milesperkWh"
value_template: "{{ value.replace(' mi/kWh', '') }}"
unit_of_measurement: "mi/kWh"
- platform: mqtt
name: "LEAF latitude"
state_topic: "leaf/MY_VIN/latitude"
- platform: mqtt
name: "LEAF longitude"
state_topic: "leaf/MY_VIN/longitude"
- platform: mqtt
name: LEAF last updated
state_topic: "leaf/MY_VIN/updated"
device_class: timestamp