forked from lonebaggie/Home_Assistant-Config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sensor.yaml
114 lines (110 loc) · 3.99 KB
/
sensor.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
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
- platform: rest
name: Quote of the Day
resource: https://quotes.rest/qod?language=en
scan_interval: 43200
json_attributes_path: '$.contents.quotes[0]'
json_attributes:
- quote
- author
- category
value_template: 'OK'
- platform: rest
name: corsa
resource: !secret psa_url1
scan_interval: 60
timeout: 30
value_template: 'OK'
json_attributes:
- energy
- timed_odometer
- battery
- platform: rest
name: corsa_charge_control
resource: !secret psa_url2
scan_interval: 60
timeout: 30
value_template: 'OK'
json_attributes:
- _next_stop_hour
- percentage_threshold
- platform: uptime
name: HA up-time
- platform: moon
- platform: time_date
display_options:
- 'time'
- 'date'
- 'date_time'
- 'date_time_iso'
- 'time_date'
- 'time_utc'
- 'beat'
- platform: template
sensors:
corsa_stop_hour:
friendly_name: "Next Stop Time"
value_template: '{{ states.sensor.corsa_charge_control.attributes["_next_stop_hour"]}}'
corsa_threshold:
friendly_name: "Threshold"
unit_of_measurement: "%"
value_template: '{{ states.sensor.corsa_charge_control.attributes["percentage_threshold"] }}'
corsa_battery_voltage:
friendly_name: "Battery Voltage"
unit_of_measurement: "V"
value_template: '{{ states.sensor.corsa.attributes["battery"]["voltage"] * 4 }}'
corsa_battery_level:
friendly_name: "Battery"
unit_of_measurement: "%"
value_template: '{{ states.sensor.corsa.attributes["energy"][0]["level"] }}'
corsa_battery_autonomy:
friendly_name: "Autonomy"
unit_of_measurement: "mi"
value_template: '{{ (states.sensor.corsa.attributes["energy"][0]["autonomy"]*0.62137)|round(0)}}'
corsa_charging_status:
friendly_name: "Charging Status"
value_template: '{{ states.sensor.corsa.attributes["energy"][0]["charging"]["status"] }}'
corsa_charging_speed:
friendly_name: "Charging Speed"
value_template: '{{ states.sensor.corsa.attributes["energy"][0]["charging"]["charging_rate"] }}'
corsa_charging_mode:
friendly_name: "Charging Mode"
value_template: '{{ states.sensor.corsa.attributes["energy"][0]["charging"]["charging_mode"] }}'
corsa_mileage:
friendly_name: "Mileage"
unit_of_measurement: "mi"
value_template: '{{ (states.sensor.corsa.attributes["timed_odometer"]["mileage"]* 0.62137)| round(0) }}'
outside_temp:
unit_of_measurement: "°C"
value_template: >
{{state_attr('weather.home','temperature')|float|round(2)}}
media_source:
value_template: >
{{state_attr('media_player.lg_webos_smart_tv','source')}}
media_channel:
value_template: >
{{state_attr('media_player.lg_webos_smart_tv','media_title')}}
light_state:
friendly_name: "living room Light state"
value_template: >
{% if states.light.living_room.state == 'off' %}
Off
{% elif (is_state_attr('light.all_living_room','color_temp',500))
or (is_state_attr('light.all_living_room','color_temp',454))
and (is_state_attr('light.all_living_room','brightness',2))
%}
Dark
{% elif (is_state_attr('light.all_living_room','color_temp',416))
and (is_state_attr('light.all_living_room','brightness',102))
%}
Relaxed
{% elif (is_state_attr('light.all_living_room','color_temp',153))
or (is_state_attr('light.all_living_room','color_temp',250))
and (is_state_attr('light.all_living_room','brightness',255))
%}
Bright
{% else %}
Unknown
{% endif %}
last_alexa:
value_template: >
{{ expand(states.group.echos) | selectattr('attributes.last_called','eq',True) | map(attribute='entity_id') | first }}