-
Notifications
You must be signed in to change notification settings - Fork 3
/
uh50reader.yaml
109 lines (100 loc) · 2.7 KB
/
uh50reader.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
esphome:
name: esp-uh50reader
platform: ESP8266
#board d1_mini also works (wemos d1 mini)
board: nodemcu
includes:
- obis.h
- uh50reader.h
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "esp-uh50reader"
password: !secret fallback_password
captive_portal:
# Uncomment the following 2 lines to enable web-access to the device to view logs and update firmware
#web_server:
# port: 80
# Enable logging
logger:
level: DEBUG
baud_rate: 0 #disable logging over uart
# Enable Home Assistant API
api:
encryption:
key: !secret encryption_key
ota:
password: !secret ota_password
uart:
- id: uart_in
rx_pin: RX
baud_rate: 2400
data_bits: 7
parity: EVEN
stop_bits: 2
rx_buffer_size: 2048
- id: uart_out
tx_pin: D4
baud_rate: 300
data_bits: 7
parity: EVEN
stop_bits: 2
sensor:
- platform: custom
lambda: |-
auto meter_sensor = new UH50Reader(id(uart_in), id(uart_out));
App.register_component(meter_sensor);
return {
meter_sensor->cumulativeActiveImport,
meter_sensor->cumulativeVolume,
meter_sensor->currentPower,
meter_sensor->flowRate,
meter_sensor->temperatureFlow,
meter_sensor->temperatureReturn,
meter_sensor->temperatureDiff
};
sensors:
- name: "UH50 Cumulative Active Import"
id: "uh50_cumulative_active_import"
unit_of_measurement: MWh
accuracy_decimals: 3
state_class: "total_increasing"
device_class: "energy"
- name: "UH50 Cumulative Volume"
id: "uh50_cumulative_volume"
unit_of_measurement: m3
accuracy_decimals: 3
state_class: "total_increasing"
device_class: "energy"
- name: "UH50 Current Power"
id: "uh50_current_power"
unit_of_measurement: kW
accuracy_decimals: 2
state_class: "measurement"
device_class: "energy"
- name: "UH50 Flow Rate"
id: "uh50_flow_rate"
unit_of_measurement: m3ph
accuracy_decimals: 3
state_class: "measurement"
device_class: "energy"
- name: "UH50 Flow Temperature"
id: "uh50_flow_temperature"
unit_of_measurement: C
accuracy_decimals: 2
state_class: "measurement"
device_class: "energy"
- name: "UH50 Return Temperature"
id: "uh50_return_temperature"
unit_of_measurement: C
accuracy_decimals: 2
state_class: "measurement"
device_class: "energy"
- name: "UH50 Diff Temperature"
id: "uh50_diff_temperature"
unit_of_measurement: C
accuracy_decimals: 2
state_class: "measurement"
device_class: "energy"