Skip to content

Instantly share code, notes, and snippets.

@lewurm
Last active November 21, 2024 22:47
Show Gist options
  • Save lewurm/6ab5a914209e8a16f4532ccfcd25b865 to your computer and use it in GitHub Desktop.
Save lewurm/6ab5a914209e8a16f4532ccfcd25b865 to your computer and use it in GitHub Desktop.
HomeAssistant Modbus configuration for Pichler LG350 Ventilation Units (possible for LG450 too)
modbus:
- name: pichlerlg350
type: tcp
host: 192.168.44.232
port: 502
delay: 2
message_wait_milliseconds: 30
binary_sensors:
- name: "lg350_bypassklappe" # 0.0
unique_id: "lg350_bypassklappe"
slave: 20
address: 20
input_type: input
device_class: opening
switches:
- name: "lg350_betriebsmodus_sommer"
slave: 20
address: 1
write_type: holding
command_on: 1 # Sommer
command_off: 2 # Winter
verify:
delay: 1
- name: "lg350_bypassklappe_force_open"
slave: 20
address: 49
write_type: holding
# data_type: uint16
command_on: 2 # Ein/Offen
command_off: 0 # Normal. "1" waere Aus/Geschlossen
verify:
delay: 1
sensors:
- name: "lg350_temp_aussenluft" # 0.0
unique_id: "lg350_temp_aussenluft"
unit_of_measurement: "ยฐC"
slave: 20
address: 30
input_type: input
data_type: int16
offset: -100
precision: 1
scale: 0.1
- name: "lg350_temp_fortluft" # 3.0
unique_id: "lg350_temp_fortluft"
unit_of_measurement: "ยฐC"
slave: 20
address: 31 # 30
input_type: input
data_type: int16
offset: -100
precision: 1
scale: 0.1
- name: "lg350_temp_abluft" # 0.2
unique_id: "lg350_temp_abluft"
unit_of_measurement: "ยฐC"
slave: 20
address: 32 # 31
input_type: input
data_type: int16
offset: -100
precision: 1
scale: 0.1
- name: "lg350_temp_zuluft" # xxx
unique_id: "lg350_temp_zuluft"
unit_of_measurement: "ยฐC"
slave: 20
address: 33 # 32
input_type: input
data_type: int16
offset: -100
precision: 1
scale: 0.1
- name: "lg350_temp_aussenluft_vhr"
unique_id: "lg350_temp_aussenluft_vhr"
unit_of_measurement: "ยฐC"
slave: 20
address: 34
input_type: input
data_type: int16
offset: -100
precision: 1
scale: 0.1
- name: "lg350_zuluftdrehzahl"
unique_id: "lg350_zuluftdrehzahl"
unit_of_measurement: "rpm"
slave: 20
address: 39
input_type: input
data_type: int16
- name: "lg350_abluftdrehzahl"
unique_id: "lg350_abluftdrehzahl"
unit_of_measurement: "rpm"
slave: 20
address: 40
input_type: input
data_type: int16
- name: "lg350_zuluftstrom"
unique_id: "lg350_zuluftstrom"
unit_of_measurement: "m3/h"
slave: 20
address: 46
input_type: input
data_type: int16
- name: "lg350_abluftstrom"
unique_id: "lg350_abluftstrom"
unit_of_measurement: "m3/h"
slave: 20
address: 47
input_type: input
data_type: int16
- name: "lg350_reststandzeit_filter"
unique_id: "lg350_reststandzeit_filter"
unit_of_measurement: "h"
slave: 20
address: 50
input_type: input
data_type: uint16
- name: "lg350_betriebsmodus_sw"
unique_id: "lg350_betriebsmodus_sw"
slave: 20
address: 1
input_type: holding
data_type: uint16
- name: "lg350_lufstrom_stufe1"
unique_id: "lg350_luftstrom_stufe1"
unit_of_measurement: "m3/h"
slave: 20
address: 9
input_type: holding
data_type: int16
- name: "lg350_lufstrom_stufe2"
unique_id: "lg350_luftstrom_stufe2"
unit_of_measurement: "m3/h"
slave: 20
address: 10
input_type: holding
data_type: int16
- name: "lg350_lufstrom_stufe3"
unique_id: "lg350_luftstrom_stufe3"
unit_of_measurement: "m3/h"
slave: 20
address: 11
input_type: holding
data_type: int16
- name: "lg350_luftstufe"
unique_id: "lg350_luftstufe"
slave: 20
address: 2
input_type: holding
data_type: int16
- name: "lg350_bypassklappe_set"
unique_id: "lg350_bypassklappe_set"
slave: 20
address: 49
input_type: holding
data_type: int16
- name: "lg350_abluftdifferenz_stufe1"
unique_id: "lg350_abluftdifferenz_stufe1"
unit_of_measurement: "m3/h"
slave: 20
address: 83
input_type: holding
data_type: int16
offset: -500
- name: "lg350_abluftdifferenz_stufe2"
unique_id: "lg350_abluftdifferenz_stufe2"
unit_of_measurement: "m3/h"
slave: 20
address: 84
input_type: holding
data_type: int16
offset: -500
- name: "lg350_abluftdifferenz_stufe3"
unique_id: "lg350_abluftdifferenz_stufe3"
unit_of_measurement: "m3/h"
slave: 20
address: 85
input_type: holding
data_type: int16
offset: -500
sensor:
- platform: template
sensors:
lg350_luftstufe_render:
friendly_name: "Luftstufe"
value_template: >-
{% set lg350_luftstufe_mapper = {
0: 'Standby',
1: 'Stufe 1',
2: 'Stufe 2',
3: 'Stufe 3',
4: 'Grundlรผftung'} %}
{% set state = states('sensor.lg350_luftstufe')|int %}
{{ lg350_luftstufe_mapper[state] if state in lg350_luftstufe_mapper else 'Unknown' }}
lg350_bypassklappe_set_render:
friendly_name: "Bypass Klappe Stellung"
value_template: >-
{% set lg350_bypassklappe_set_mapper = {
0: 'Normal',
1: 'Aus/Geschlossen',
2: 'Ein/Offen'} %}
{% set state = states('sensor.lg350_bypassklappe_set')|int %}
{{ lg350_bypassklappe_set_mapper[state] if state in lg350_bypassklappe_set_mapper else 'Unknown' }}
lg350_betriebsmodus_sw_render:
friendly_name: "Betriebsmodus"
value_template: >-
{% set lg350_betriebsmodus_sw_mapper = {
1: 'Sommer',
2: 'Winter'} %}
{% set state = states('sensor.lg350_betriebsmodus_sw')|int %}
{{ lg350_betriebsmodus_sw_mapper[state] if state in lg350_betriebsmodus_sw_mapper else 'Unknown' }}
template:
- sensor:
- name: "LG350 Heizleistung"
unique_id: "lg350_heizleistung"
state_class: "measurement"
unit_of_measurement: "W"
device_class: power
state: >
{% set vorlauf = states('sensor.lg350_temp_zuluft') | float (0) %}
{% set ruecklauf = states('sensor.lg350_temp_abluft') | float %}
{% set durchfluss = states('sensor.lg350_zuluftstrom') | float %}
{{ ((vorlauf - ruecklauf) * durchfluss * 0.33 ) | round(1, default=0) }}
@boxleits
Copy link

boxleits commented Nov 4, 2024

Hi @lewurm,
came here via energiesparhaus.at
how did you find the register numbers for rpm values (39,40)? did not find them in the modbus documentation from pichler website
https://www.pichlerluft.at/dezentral-wohnungsweise-lueftungsgeraete.html?file=files/content/downloads/LOGIN/LG%20350_LG%20450_LG%20740_LG%201000%20SK/LIST_Modbus_ES2020_FW_Cv14_LG350_LG450_LG740_LG1000_v14_D-E.xlsx
do you have more registers numbers that are not documented there? :)

Thanks and regards
Stefan

@lewurm
Copy link
Author

lewurm commented Nov 5, 2024

Hey @boxleits,

I don't remember specifically the story behind the rpm values, but some were found be the user berhan in the energiesparhaus.at forum. some values have been figured out by dumping all the modbus registers and cross check the behaviour by changing stuff in the service menu via the touch panel. For example the registers 83-85 have been figured out that way. All registers that I know (and care of) are in this yaml file.

To be honest I haven't seen your linked document so far, how did you find that?! :-) I'm only aware of the KNX one, that partially maps to the modbus layout. This looks super useful, thank you!

@boxleits
Copy link

boxleits commented Nov 5, 2024

The manufacturer's documentation is publicly available:
https://www.pichlerluft.at/ -> Komfort-Service -> Download -> Unterlagen -> Modbuslisten LG-Serie

How did you find the formula to calculate the heating power: (vorlauf - ruecklauf) * durchfluss * 0.33 ?
When I tried to figure out a way to calculate and measure efficiency of the heat exchanger, i learned that i would have to take absolute air humidity levels into account (wet air contains more energy than dry air). That is why i dismissed the idea eventually.

@lewurm
Copy link
Author

lewurm commented Nov 5, 2024

How did you find the formula to calculate the heating power: (vorlauf - ruecklauf) * durchfluss * 0.33 ?

I assumed that 0.33Wh is needed to increase 1 m3 of air by 1 K. But indeed, it ignores humidity.

@lewurm
Copy link
Author

lewurm commented Nov 5, 2024

The manufacturer's documentation is publicly available:
https://www.pichlerluft.at/ -> Komfort-Service -> Download -> Unterlagen -> Modbuslisten LG-Serie

I swear this wasn't there a couple months ago ๐Ÿ˜… thank you!!

@mihu-ov
Copy link

mihu-ov commented Nov 6, 2024

Forgive my ignorance, but can I save this as lg350.yml and just have an include in configuration.yaml? Or do I have to distribute this to modbus / sensor / template?
Thank you, just received my modbus interface and this helps a lot :-)

@lewurm
Copy link
Author

lewurm commented Nov 7, 2024

@mihu-ov you can copy paste it into your configuration.yaml or you try, as you suggested, to include it. Under Settings -> Devices & Services you should see a ModBus integration then with the entities defined.

FWIW I didn't use the Pichler Modbus device, but just attached it an ESP32 with an RS485 converter to "L11" (see picture). The ESP32 runs Tasmota and uses the the ModBus Bridge feature which makes it available as ModBus TCP, which can be accessed from Home Assistant then.

Screenshot 2024-11-07 at 15 19 53

@mihu-ov
Copy link

mihu-ov commented Nov 7, 2024

Thank you, working fine now with a cheap Elfin EE11A Ethernet to RS485 device connected to L11!

@lewurm
Copy link
Author

lewurm commented Nov 7, 2024

Thank you, working fine now with a cheap Elfin EE11A Ethernet to RS485 device connected to L11!

Nice! ๐Ÿ™‚

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment