-
Notifications
You must be signed in to change notification settings - Fork 0
/
abrp_rest.yaml
99 lines (88 loc) · 4.4 KB
/
abrp_rest.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
rest_command:
abrp:
url: >
http://api.iternio.com/1/tlm/send?api_key={{ states('sensor.iternio_api_key') }}&token={{ states('sensor.abrp_api_key') }}&tlm={
"utc": {{ utcnow().strftime('%s') }},
"soc": {{ states('sensor.battery') | default(0) }},
"power": {{ states('sensor.zoe_charge_power') | default(0) }},
"lat": {{ state_attr('device_tracker.location', 'latitude') | default(0) }},
"lon": {{ state_attr('device_tracker.location', 'longitude') | default(0) }},
"is_charging": {{ 'true' if is_state('binary_sensor.charging', 'on') else 'false' }},
"ext_temp": {{
states('sensor.home_realfeel_temperature') if states('sensor.home_realfeel_temperature') != 'unavailable'
else states('sensor.openweathermap_temperature') if states('sensor.openweathermap_temperature') != 'unknown'
else 0
}},
"batt_temp": {{ states('sensor.battery_temperature') | default(states('sensor.home_realfeel_temperature') | default(0)) }}
}
method: POST
headers:
content_type: "application/x-www-form-urlencoded; charset=utf-8"
abrp_telemetry:
url: >
http://api.iternio.com/1/tlm/send?api_key={{ states('sensor.iternio_api_key') }}&token={{ states('sensor.abrp_api_key') }}&tlm={
"utc": {{ utcnow().strftime('%s') }},
"soc": {{ states('sensor.battery') | default(0) }},
"power": {{ states('sensor.zoe_charge_power') | default(0) }},
"is_charging": {{ 'true' if is_state('binary_sensor.charging', 'on') else 'false' }},
"ext_temp": {{
states('sensor.home_realfeel_temperature') if states('sensor.home_realfeel_temperature') != 'unavailable'
else states('sensor.openweathermap_temperature') if states('sensor.openweathermap_temperature') != 'unknown'
else 0
}},
"batt_temp": {{ states('sensor.battery_temperature') | default(states('sensor.home_realfeel_temperature') | default(0)) }}
}
method: POST
headers:
content_type: "application/x-www-form-urlencoded; charset=utf-8"
abrp_soc:
url: >
http://api.iternio.com/1/tlm/send?api_key={{ states('sensor.iternio_api_key') }}&token={{ states('sensor.abrp_api_key') }}&tlm={
"utc": {{ utcnow().strftime('%s') }},
"soc": {{ states('sensor.battery') | default(0) }}
}
method: POST
headers:
content_type: "application/x-www-form-urlencoded; charset=utf-8"
abrp_power:
url: >
http://api.iternio.com/1/tlm/send?api_key={{ states('sensor.iternio_api_key') }}&token={{ states('sensor.abrp_api_key') }}&tlm={
"utc": {{ utcnow().strftime('%s') }},
"power": {{ states('sensor.zoe_charge_power') | default(0) }}
}
method: POST
headers:
content_type: "application/x-www-form-urlencoded; charset=utf-8"
abrp_location:
url: >
http://api.iternio.com/1/tlm/send?api_key={{ states('sensor.iternio_api_key') }}&token={{ states('sensor.abrp_api_key') }}&tlm={
"utc": {{ utcnow().strftime('%s') }},
"lat": {{ state_attr('device_tracker.location', 'latitude') | default(0) }},
"lon": {{ state_attr('device_tracker.location', 'longitude') | default(0) }}
}
method: POST
headers:
content_type: "application/x-www-form-urlencoded; charset=utf-8"
abrp_charging:
url: >
http://api.iternio.com/1/tlm/send?api_key={{ states('sensor.iternio_api_key') }}&token={{ states('sensor.abrp_api_key') }}&tlm={
"utc": {{ utcnow().strftime('%s') }},
"is_charging": {{ 'true' if is_state('binary_sensor.charging', 'on') else 'false' }}
}
method: POST
headers:
content_type: "application/x-www-form-urlencoded; charset=utf-8"
abrp_temperatures:
url: >
http://api.iternio.com/1/tlm/send?api_key={{ states('sensor.iternio_api_key') }}&token={{ states('sensor.abrp_api_key') }}&tlm={
"utc": {{ utcnow().strftime('%s') }},
"ext_temp": {{
states('sensor.home_realfeel_temperature') if states('sensor.home_realfeel_temperature') != 'unavailable'
else states('sensor.openweathermap_temperature') if states('sensor.openweathermap_temperature') != 'unknown'
else 0
}},
"batt_temp": {{ states('sensor.battery_temperature') | default(states('sensor.home_realfeel_temperature') | default(0)) }}
}
method: POST
headers:
content_type: "application/x-www-form-urlencoded; charset=utf-8"