Witajcie! Jakiś czas temu przygotowałem film, w którym pokazuję, jak wykonać kabelek do podłączenia rekuperatora z konwerterem RS485 ↔ WiFi, umożliwiający komunikację z Home Assistant.
Konfiguracja była testowana na rekuperatorze z serii AirPack4 Home. W tym wpisie chciałbym uporządkować treść i udostępnić wszystkie potrzebne pliki, aby było to łatwo dostępne i czytelne.
Zacznijmy od materiału źródłowego wideo. Reszta wpisu, wraz z plikami, znajduje się poniżej.
VIDEO
Najważniejsze elementy, które będą nam potrzebne, to:
Konwerter Modbus (ja użyłem Elfin EW11 na WiFi, ale można użyć innego lub nawet połączenia kablowego)
Kawałek kabla RJ45
2 wtyczki RJ45
Zaciskarka
1. Połączenie kablowe Rekuperator ↔ Adapter RS485
Pierwszym krokiem jest przygotowanie odpowiedniego kableka do połączenia urządzeń według poniższego schematu:
Taki układ pozwala zasilać konwerter Elfin bezpośrednio z portu rekuperatora.
Tak przygotowany kabelek podłączamy odpowiednią stroną do portu 11 w rekuperatorze, zgodnie z instrukcją producenta.
Screen z instrukcji producenta
2. Konfiguracja WiFi w adapterze
Po podłączeniu adapter zaczyna rozgłaszać sieć WiFi. Należy połączyć się z tą siecią i wybrać z dostępnych sieci WiFi tę, do której chcemy się podłączyć, podając prawidłowe hasło. Następnie logujemy się do naszego routera, aby sprawdzić, jaki adres IP został przydzielony urządzeniu. Po ustaleniu adresu IP wchodzimy na stronę konfiguracji adaptera i ustawiamy odpowiednie parametry.
Ustawienia połączenia portu szeregowego (SERIAL PORT SETTINGS)
2. Ustawienia komunikacji (COMMUNICATION SETTINGS):
WAŻNE!
Póki nie zostanie wykonana konfiguracja w Home Assistant, adapter nie będzie pokazywał komunikacji.
3. Konfiguracja w Home Assistant
W pliku configuration.yaml wklejamy poniższy kod. Ważne, aby zmienić adres IP na ten przydzielony przez sieć LAN.
# REKUPERATOR MODBUS
modbus:
- type: tcp
host: 192.168.1.179
show more
# REKUPERATOR MODBUS
modbus:
- type: tcp
host: 192.168.1.179
port: 9999
name: reku
timeout: 5
delay: 2
sensors:
- name: "Rekuperator Temperatura Czerpnia"
slave: 10
address: 16
input_type: input
scan_interval: 29
data_type: int16
unit_of_measurement: °C
scale: 0.1
precision: 1
- name: "Rekuperator Temperatura Nawiew"
slave: 10
address: 17
input_type: input
scan_interval: 29
data_type: int16
unit_of_measurement: °C
scale: 0.1
precision: 1
- name: "Rekuperator Temperatura Wywiew"
slave: 10
address: 18
input_type: input
scan_interval: 29
data_type: int16
unit_of_measurement: °C
scale: 0.1
precision: 1
- name: "Rekuperator Temperatura za FPX"
slave: 10
address: 19
input_type: input
scan_interval: 29
data_type: int16
unit_of_measurement: °C
scale: 0.1
precision: 1
- name: "Rekuperator Temperatura PCB"
slave: 10
address: 22
input_type: input
data_type: int16
scan_interval: 59
unit_of_measurement: °C
scale: 0.1
precision: 1
- name: "Rekuperator Strumień nawiew"
slave: 10
address: 256
input_type: holding
scan_interval: 2
data_type: int16
unit_of_measurement: m3/h
scale: 1
precision: 1
- name: "Rekuperator Strumień wywiew"
slave: 10
address: 257
input_type: holding
scan_interval: 2
data_type: int16
unit_of_measurement: m3/h
scale: 1
precision: 1
- name: "Rekuperator lato zima"
scan_interval: 11
data_type: int16
slave: 10
address: 4209
input_type: holding
- name: "Rekuperator Bypass"
scan_interval: 11
data_type: int16
slave: 10
address: 4320
input_type: holding
- name: "Rekuperator tryb pracy"
scan_interval: 6
data_type: int16
slave: 10
address: 4208
input_type: holding
- name: "Rekuperator speedmanual"
scan_interval: 5
data_type: int16
unit_of_measurement: "%"
slave: 10
address: 4210
input_type: holding
- name: "Rekuperator fpx flaga"
scan_interval: 29
data_type: int16
unit_of_measurement: ""
slave: 10
address: 4192
input_type: holding
- name: "Rekuperator FPX tryb"
scan_interval: 29
data_type: int16
unit_of_measurement: ""
slave: 10
address: 4198
input_type: holding
- name: "Rekuperator Alarm"
scan_interval: 63
slave: 10
data_type: int16
address: 8192
input_type: holding
unit_of_measurement: ""
- name: "Rekuperator Error"
scan_interval: 63
slave: 10
address: 8193
data_type: int16
input_type: holding
unit_of_measurement: ""
- name: "Rekuperator FPX zabezpieczenie termiczne"
scan_interval: 63
slave: 10
address: 8208
data_type: int16
input_type: holding
unit_of_measurement: ""
- name: "Rekuperator Awaria Wentylatora Nawiewu"
scan_interval: 63
slave: 10
address: 8222
data_type: int16
input_type: holding
unit_of_measurement: ""
- name: "Rekuperator Awaria Wentylatora Wywiewu"
scan_interval: 63
slave: 10
address: 8223
data_type: int16
input_type: holding
unit_of_measurement: ""
- name: "Rekuperator Awaria CF Nawiewu"
scan_interval: 63
slave: 10
address: 8330
data_type: int16
input_type: holding
unit_of_measurement: ""
- name: "Rekuperator Awaria CF Wywiewu"
scan_interval: 63
slave: 10
address: 8331
data_type: int16
input_type: holding
unit_of_measurement: ""
- name: "Rekuperator Wymiana Filtrów"
scan_interval: 63
slave: 10
address: 8444
data_type: int16
input_type: holding
unit_of_measurement: ""
binary_sensors:
- name: "Rekuperator Silownik bypassu"
scan_interval: 21
slave: 10
address: 9
- name: "Rekuperator Potwierdzenie pracy"
scan_interval: 1
slave: 10
address: 11
switches:
- name: "Rekuperator Wietrzenie"
scan_interval: 1
slave: 10
address: 4224
command_on: 7
command_off: 0
verify:
- name: "Rekuperator Pusty Dom"
scan_interval: 5
slave: 10
address: 4224
command_on: 11
command_off: 0
verify:
- name: "Rekuperator bypass"
scan_interval: 7
slave: 10
address: 4320
command_on: 0
command_off: 1
verify:
- name: "Rekuperator Kominek"
scan_interval: 5
slave: 10
address: 4224
command_on: 2
command_off: 0
verify:
- name: "Rekuperator Okna"
scan_interval: 5
slave: 10
address: 4224
command_on: 10
command_off: 0
verify:
- name: "Rekuperator ON/OFF"
scan_interval: 5
slave: 10
address: 4387
command_on: 1
command_off: 0
verify:
- name: "Rekuperator mode"
scan_interval: 1
slave: 10
address: 4208
command_on: 0
command_off: 1
verify:
- name: "Rekuperator zima"
scan_interval: 7
slave: 10
address: 4209
command_on: 1
command_off: 0
verify:
show less
Oraz dodatkowe pliki które obliczają nam zużycie itp.
utility_meter:
rekuperator_odzysk_energii_godzina:
source: sensor.rekuperator_odzyskana_energia
cycle: hourly
rekuperator_odzysk_energii_dzien:
source: sensor.rekuperator_odzyskana_energia
cycle: daily
show more
utility_meter:
rekuperator_odzysk_energii_godzina:
source: sensor.rekuperator_odzyskana_energia
cycle: hourly
rekuperator_odzysk_energii_dzien:
source: sensor.rekuperator_odzyskana_energia
cycle: daily
rekuperator_odzysk_energii_miesiac:
source: sensor.rekuperator_odzyskana_energia
cycle: monthly
rekuperator_odzysk_energii_rok:
source: sensor.rekuperator_odzyskana_energia
cycle: yearly
template:
sensor:
- name: "Rekuperator Sprawność"
unique_id: "sensor.rekuperator_sprawnosc"
icon: "mdi:percent"
unit_of_measurement: "%"
state: >-
{% if is_state('binary_sensor.rekuperator_silownik_bypassu', 'off') %}
{% set t1 = states('sensor.rekuperator_temperatura_czerpnia') | float %}
{% set t2 = states('sensor.rekuperator_temperatura_nawiew') | float %}
{% set t3 = states('sensor.rekuperator_temperatura_wywiew') | float %}
{{ (((t2 - t1) / (t3 - t1)) * 100|float) | round(2, default=0) }}
{% else %}
0
{% endif %}
- name: "Rekuperator Wysterowanie Nawiew"
unique_id: "sensor.rekuperator_wysterowanie_nawiew"
icon: "mdi:percent"
unit_of_measurement: "%"
state: >
{% set flowN = states('sensor.rekuperator_strumien_nawiew') | float %}
{{ ((flowN * 100) / 320 |float) | round(2, default=0) }}
- name: "Rekuperator Wysterowanie wywiew"
unique_id: "sensor.rekuperator_wysterowanie_wywiew"
icon: "mdi:percent"
unit_of_measurement: "%"
state: >
{% set flowW = states('sensor.rekuperator_strumien_wywiew') | float %}
{{ ((flowW * 100) / 320|float) | round(2, default=0) }}
- name: "Rekuperator Odzyskana Moc"
unique_id: "sensor.rekuperator_odzyskana_moc"
icon: "mdi:counter"
unit_of_measurement: "W"
state: >-
{% if is_state('binary_sensor.rekuperator_silownik_bypassu', 'off') %}
{% set strumienN = states('sensor.rekuperator_strumien_nawiew') | float %}
{% set tcz = states('sensor.rekuperator_temperatura_czerpnia') | float %}
{% set tn = states('sensor.rekuperator_temperatura_nawiew') | float %}
{% if states('sensor.rekuperator_temperatura_czerpnia')|float < states('sensor.rekuperator_strumien_nawiew')|float %}
{{ ((((tn - tcz) * strumienN * 1200) / 3600)|float) | round(2, default=0) }}
{% else %}
{{ (((((tn - tcz) * strumienN * 1200) / 3600) * -1)|float) | round(2, default=0) }}
{% endif %}
{% else %}
0
{% endif %}
sensor:
- platform: integration
source: sensor.rekuperator_odzyskana_moc
name: rekuperator_odzyskana_energia
unit_prefix: k
round: 3
show less
Po zapisaniu pliku wykonujemy restart Home Assistant. Po restarcie komunikacja przez adapter Elfin powinna działać poprawnie.
4. Karta rekuperatora w UI
Mając wszystkie encje, możemy skonfigurować kartę do wyświetlania danych w interfejsie użytkownika.
Najpierw warto skopiować pliki na serwer do katalogu:
IP_HA > config\www
W to miejsce kopiujemy wszystkie pliki z grafikami z linku: https://bartekbuduje.pl/reku.zip
Kod karty UI
type: vertical-stack
cards:
- type: horizontal-stack
cards:
- type: button
tap_action:
action: toggle
type: vertical-stack
cards:
- type: horizontal-stack
cards:
- type: button
tap_action:
action: toggle
entity: switch.rekuperator_on_off
name: Praca
show_state: true
icon: mdi:air-filter
show_name: true
show_icon: true
- type: button
tap_action:
action: more-info
entity: binary_sensor.rekuperator_silownik_bypassu
name: Bypass
show_state: true
icon: mdi:arrow-decision
- type: conditional
conditions:
- entity: switch.rekuperator_zima
state: 'on'
card:
type: button
tap_action:
action: toggle
entity: switch.rekuperator_zima
name: Zima
icon: mdi:snowflake
- type: conditional
conditions:
- entity: switch.rekuperator_zima
state: 'off'
card:
type: button
tap_action:
action: toggle
entity: switch.rekuperator_zima
name: Lato
icon: mdi:sun-snowflake
- type: button
tap_action:
action: toggle
entity: switch.rekuperator_mode
name: Auto
show_state: true
icon: mdi:home-floor-a
- type: horizontal-stack
cards:
- type: button
tap_action:
action: call-service
service: modbus.write_register
service_data:
address: 4210
unit: 10
value: 60
hub: reku
target: {}
entity: input_boolean.test
show_icon: false
name: 60%
- type: button
tap_action:
action: call-service
service: modbus.write_register
service_data:
address: 4210
unit: 10
value: 70
hub: reku
target: {}
entity: input_boolean.test
show_icon: false
name: 70%
- type: button
tap_action:
action: call-service
service: modbus.write_register
service_data:
address: 4210
unit: 10
value: 80
hub: reku
target: {}
entity: input_boolean.test
show_icon: false
name: 80%
- type: button
tap_action:
action: call-service
service: modbus.write_register
service_data:
address: 4210
unit: 10
value: 90
hub: reku
target: {}
entity: input_boolean.test
show_icon: false
name: 90%
- type: button
tap_action:
action: call-service
service: modbus.write_register
service_data:
address: 4210
unit: 10
value: 100
hub: reku
target: {}
entity: input_boolean.test
show_icon: false
name: 100%
- type: picture-elements
elements:
- type: state-label
entity: sensor.rekuperator_temperatura_czerpnia
style:
top: 27%
left: 7%
color: black
- type: state-label
entity: sensor.rekuperator_temperatura_za_fpx
style:
top: 14%
left: 19%
- type: state-label
entity: sensor.rekuperator_temperatura_nawiew
style:
top: 54%
left: 94%
color: black
- type: state-label
entity: sensor.rekuperator_strumien_nawiew
style:
top: 72%
left: 93%
- type: state-label
entity: sensor.rekuperator_wysterowanie_nawiew
style:
top: 65%
left: 94%
- type: state-label
entity: sensor.rekuperator_temperatura_wywiew
style:
top: 27%
left: 94%
color: black
- type: state-label
entity: sensor.rekuperator_strumien_wywiew
style:
top: 10%
left: 92%
- type: state-label
entity: sensor.rekuperator_wysterowanie_wywiew
style:
top: 18%
left: 94%
- type: state-label
entity: sensor.rekuperator_sprawnosc
style:
top: 80%
left: 50%
- type: state-label
entity: sensor.rekuperator_temperatura_pcb
style:
top: 72%
left: 35%
- type: state-label
entity: sensor.rekuperator_odzyskana_moc
style:
top: 90%
left: 50%
- type: state-label
entity: sensor.rekuperator_speedmanual
style:
top: 85%
left: 12%
border: 1px solid white
border-radius: 5%
- type: image
entity: binary_sensor.rekuperator_silownik_bypassu
state_image:
'on': /local/reku_bypass3.png
'off': /local/reku_empty.png
style:
top: 41%
left: 51%
width: 25%
- type: image
entity: sensor.rekuperator_fpx_flaga
state_image:
'0': /local/reku_empty.png
'1': /local/reku_fpx.png
style:
top: 8%
left: 52.5%
width: 10%
- type: image
entity: sensor.rekuperator_fpx_tryb
state_image:
'0': /local/reku_empty.png
'1': /local/reku_1.png
'2': /local/reku_2.png
style:
top: 8%
left: 60%
width: 3.5%
- type: image
entity: sensor.rekuperator_alarm
state_image:
'0': /local/reku_empty.png
'1': /local/reku_alarm.png
style:
top: 8%
left: 20%
width: 15%
- type: image
entity: sensor.rekuperator_error
state_image:
'0': /local/reku_empty.png
'1': /local/reku_alarm.png
style:
top: 8%
left: 20%
width: 15%
- type: image
entity: sensor.rekuperator_awaria_cf_nawiewu
state_image:
'0': /local/reku_empty.png
'1': /local/reku_alarm.png
style:
top: 8%
left: 20%
width: 15%
- type: image
entity: sensor.rekuperator_awaria_cf_wywiewu
state_image:
'0': /local/reku_empty.png
'1': /local/reku_alarm.png
style:
top: 8%
left: 20%
width: 15%
- type: image
entity: sensor.rekuperator_awaria_wentylatora_nawiewu
state_image:
'0': /local/reku_empty.png
'1': /local/reku_alarm.png
style:
top: 8%
left: 20%
width: 15%
- type: image
entity: sensor.rekuperator_awaria_wentylatora_wywiewu
state_image:
'0': /local/reku_empty.png
'1': /local/reku_alarm.png
style:
top: 8%
left: 20%
width: 15%
- type: image
entity: sensor.rekuperator_fpx_zabezpieczenie_termiczne
state_image:
'0': /local/reku_empty.png
'1': /local/reku_alarm.png
style:
top: 8%
left: 20%
width: 15%
- type: image
entity: sensor.rekuperator_wymiana_filtrow
state_image:
'0': /local/reku_empty.png
'1': /local/reku_alarm.png
style:
top: 8%
left: 20%
width: 15%
image: /local/reku_nobypass3.png
- type: horizontal-stack
cards:
- type: button
tap_action:
action: call-service
service: modbus.write_register
service_data:
address: 4210
unit: 10
value: 10
hub: reku
target: {}
entity: input_boolean.test
show_icon: false
name: 10%
- type: button
tap_action:
action: call-service
service: modbus.write_register
service_data:
address: 4210
unit: 10
value: 20
hub: reku
target: {}
entity: input_boolean.test
show_icon: false
name: 20%
- type: button
tap_action:
action: call-service
service: modbus.write_register
service_data:
address: 4210
unit: 10
value: 30
hub: reku
target: {}
entity: input_boolean.test
show_icon: false
name: 30%
- type: button
tap_action:
action: call-service
service: modbus.write_register
service_data:
address: 4210
unit: 10
value: 40
hub: reku
target: {}
entity: input_boolean.test
show_icon: false
name: 40%
- type: button
tap_action:
action: call-service
service: modbus.write_register
service_data:
address: 4210
unit: 10
value: 50
hub: reku
target: {}
entity: input_boolean.test
show_icon: false
name: 50%
- type: horizontal-stack
cards:
- type: button
tap_action:
action: toggle
entity: switch.rekuperator_pusty_dom
name: Pusty dom
icon: mdi:home-account
show_state: true
- type: button
tap_action:
action: toggle
entity: switch.rekuperator_wietrzenie
name: Wietrzenie
show_state: true
icon: mdi:fan
- type: button
tap_action:
action: toggle
entity: switch.rekuperator_okna
name: Otwarte okna
show_state: true
icon: mdi:window-open-variant
- type: button
tap_action:
action: toggle
entity: switch.rekuperator_kominek
name: Kominek
show_state: true
icon: mdi:fireplace
show less
Karty zużycia energii
type: entities
entities:
- entity: sensor.rekuperator_odzysk_energii_godzina
- entity: sensor.rekuperator_odzysk_energii_dzien
- entity: sensor.rekuperator_odzysk_energii_miesiac
- entity: sensor.rekuperator_odzysk_energii_rok
- entity: sensor.rekuperator_odzyskana_energia
type: entities
entities:
- entity: sensor.rekuperator_alarm
- entity: sensor.rekuperator_error
- entity: sensor.rekuperator_awaria_cf_nawiewu
- entity: sensor.rekuperator_awaria_cf_wywiewu
- entity: sensor.rekuperator_awaria_wentylatora_nawiewu
- entity: sensor.rekuperator_awaria_wentylatora_wywiewu
- entity: sensor.rekuperator_error
- entity: sensor.rekuperator_fpx_zabezpieczenie_termiczne
- entity: sensor.rekuperator_wymiana_filtrow
- entity: sensor.rekuperator_tryb_pracy
Od tego momentu możecie cieszyć się połączeniem między Home Assistant a rekuperatorem!