-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathrestful.yaml
More file actions
53 lines (48 loc) · 2.03 KB
/
restful.yaml
File metadata and controls
53 lines (48 loc) · 2.03 KB
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
#
# This is an example how to use the RESTful integration that comes with Home Assistant
# to define entities that get their values from polling zenSDK locally on your device.
#
# https://www.home-assistant.io/integrations/rest/
rest:
- resource: http://espressif/properties/report # edit the hostname for HA to reach your device
sensor:
- name: "Zendure SolarFlow Solar Input"
value_template: "{{ value_json['properties']['solarInputPower'] }}"
device_class: power
unit_of_measurement: W
unique_id: solarflow_solarInputPower # you can change this to include deviceId for uniqueness
- name: "Zendure SolarFlow Home Output"
value_template: "{{ value_json['properties']['outputHomePower'] }}"
device_class: power
unit_of_measurement: W
unique_id: solarflow_outputHomePower
- name: "Zendure SolarFlow Battery Level"
value_template: "{{ value_json['properties']['electricLevel'] }}"
device_class: battery
unit_of_measurement: "%"
unique_id: solarflow_electricLevel
- name: Zendure SolarFlow Home Output Limit
value_template: "{{ value_json['properties']['outputLimit'] }}"
device_class: battery
unit_of_measurement: "W"
unique_id: solarflow_outputLimit
# a rest_command is used to write zenSDK settings
# this can then be used in automations
# you have the send the value to set as well as the serial number for authentication
# as "data" to the commands
# the automations are defined in automations.yaml
rest_command:
solarflow_set_output_limit:
name: "Set SolarFlow Home Output limit"
url: http://espressif/properties/write
method: POST
payload: '{"sn":"{{sn}}", "properties": {"outputLimit": {{outputLimit}} }}'
# we can then use an input slider that will be connected to the property via automations
input_number:
solarflow_input_output_limit:
name: Target SolarFlow Home Output Slider
min: 0
max: 800
step: 50
unit_of_measurement: W
icon: mdi:battery-arrow-down