-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathconfiguration-direto.yaml
174 lines (162 loc) · 4.03 KB
/
configuration-direto.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
modbus:
- name: edp_box_1
type: serial
method: rtu
port: /dev/ttyUSB1
baudrate: 9600
stopbits: 1
bytesize: 8
parity: N
delay: 1
timeout: 5
retries: 5
retry_on_empty: true
message_wait_milliseconds: 200
sensors:
- name: 'EDP Box - Frequência'
scan_interval: 5
slave: 1
address: 127
input_type: input
unit_of_measurement: 'Hz'
count: 1
scale: 0.1
offset: 0
precision: 2
# long unsigned
data_type: uint16
- name: 'EDP Box - Tensão'
scan_interval: 5
slave: 1
address: 108
input_type: input
unit_of_measurement: 'V'
count: 1
scale: 0.1
offset: 0
precision: 1
# long unsigned
data_type: uint16
device_class: voltage
- name: 'EDP Box - Corrente'
scan_interval: 5
slave: 1
address: 109
input_type: input
unit_of_measurement: 'A'
count: 1
scale: 0.1
offset: 0
precision: 1
# long unsigned
data_type: uint16
device_class: current
- name: "EDP Box - Potência Ativa"
slave: 1
address: 121
input_type: input
count: 1
data_type: uint32
precision: 1
scale: 1
unit_of_measurement: W
device_class: power
- name: 'EDP Box - Fator de Potência'
scan_interval: 5
slave: 1
address: 123
input_type: input
unit_of_measurement: 'p.u.'
count: 1
scale: 0.001
offset: 0
precision: 3
# long unsigned
data_type: uint16
device_class: power_factor
- name: 'ICP State L1'
## 0 para disconectado - 1 para conectado - 2 para preparado a reconectar
scan_interval: 5
slave: 1
address: 132
input_type: input
count: 1
data_type: custom
structure: ">Bx"
- name: 'Tariff L1'
## 1 para Vazio - 2 para Ponta - 3 para Cheia
scan_interval: 10
slave: 1
address: 11
input_type: input
count: 1
data_type: custom
structure: ">Bx"
- name: "EDP Box - Total Vazio"
scan_interval: 30
slave: 1
address: 38
input_type: input
count: 1
data_type: uint32
precision: 3
scale: 0.001
unit_of_measurement: kWh
device_class: 'energy'
- name: "EDP Box - Total Ponta"
scan_interval: 10
slave: 1
address: 39
input_type: input
count: 1
data_type: uint32
precision: 3
scale: 0.001
unit_of_measurement: kWh
device_class: 'energy'
- name: "EDP Box - Total Cheia"
scan_interval: 10
slave: 1
address: 40
input_type: input
count: 1
data_type: uint32
precision: 3
scale: 0.001
unit_of_measurement: kWh
device_class: 'energy'
sensor:
## EDP BOX Tarifa - MODBUS
- platform: template
sensors:
edp_box_tarifa:
friendly_name: 'EDP Box - Tarifa'
icon_template: "{{ 'mdi:counter' }}"
value_template: >-
{% set x = states('sensor.tariff_l1')|string %}
{% if x == "1" %}
{{ "Vazio" }}
{% elif x == "2" %}
{{ "Ponta" }}
{% elif x == "3" %}
{{ "Cheia" }}
{% else %}
{{ x }}
{% endif %}
## EDP BOX Estado ICP - MODBUS
- platform: template
sensors:
edp_box_estado_icp:
friendly_name: 'EDP Box - Estado ICP'
icon_template: "{{ 'mdi:flash' }}"
value_template: >-
{% set x = states('sensor.icp_state_l1')|string %}
{% if x == "0" %}
{{ "Desligado" }}
{% elif x == "1" %}
{{ "Ligado" }}
{% elif x == "2" %}
{{ "Preparado para religação" }}
{% else %}
{{ x }}
{% endif %}