i have a heatpump (LG Therma V) which I connect to via the Modbus integation (modbusTCP).
The most parameters I can read are temperature or basic on/off switches.
But some parameters are a list of possible values which are stored as integers; like this:
What I would like to achieve is that I can have a dropdown/radiobutton list in my dashboard where I can read/update that energy state (as well as all other options of my heat-pump).
I have made a Helper with all the status. What I need is a starting point on how I can link those states to the integer value I can read/write from and to the modbus. In C# I would have made an enum and a databinding between the parameter and that enum.
I’ve never used Modbus, so this might not be 100% what you need… but to link your helper to the value of the sensor you need an automation (or you could ditch the helper and use a template select which is basically a helper and automation rolled into one)
Since the sensor values are well-matched with the array index, you should be able to eliminate the mapping by using the value from the sensor to pull the value of the select’s option… (untested)
- id: map energy state
alias: Energy State
description: ''
trigger:
- platform: state
entity_id:
- sensor.energy_state_input_holding
id: input
to:
- platform: state
entity_id:
- input_select.wp_energy_state
id: select
to:
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: input
sequence:
- variables:
index: '{{ trigger.to_state.state | int(0) }}'
- service: input_select.select_option
data:
option: '{{ state_attr("input_select.wp_energy_state", "options")[ index ] }}'
target:
entity_id: input_select.wp_energy_state
- conditions:
- condition: trigger
id: select
sequence:
- service: modbus.write_register
data_template:
address: 9
slave: 1
hub: lg_modbus
value: '{{ trigger.to_state.state[0] | int(0) }}'
Hi @doezel,
can you please tell me, how you configure your heatpump to activate the modbus. I use a LG Therma V Monoblock HM091MR.U44 and looking for the right configuration.
And what kind of modbusTCP device do you use?
Claus
I have the same heatpump as Claus. And at the moment I’m trying to decide if I go with the modbus approach ou wifi via LG thinq.
The thing is, never used neither of them and for both I have to adquire extra hardware. Could you point me in the right direction to learn how to use modbus with HA? I’ve seen a lot of diferent approaches, but since you have one that works I was hoping your guidance would be the most wiser.
The standard Wifi solution of LG is VERY limited. It shows hardly any sensors and can’t control the 2nd circuit if you have that connected.
The modbus solution is a lot cheaper and gives access to ALL parameters that are in our ThermaV heatpump. But this solution isn’t really plug-and-play.
I haven’t found one. You use setup the Home Assistant modbus integration to get all parameters you need. Those parameters are in the LG integration manual.
And then you automate and add graphics for all those parameters in Home Assistant.
Yes I belive the instalation manual has a lot of info about the modbus connection, going to dig that up.
Hardware wise, you used the rs232/rs485 in opposition to just the rs485 for any reason?
In my local Amazon the rs485 is almost half the price of the rs232/rs485.
Ok I think I found it
It’s the “third party controller” marked terminal block on external unit (either on split or monobloc model).
This can be found on installation manual.
Hi Doezel.
If someone asks you to explain on which connector you wired your convertor, why don’t you give an answer? No one on the Internet explains how it’s connected .
It should be something like
"There is a terminalblock in the heat pump with a text “Aansturing voor besturing van derde”. In my HP it’s terminalblock 3. It has two connections numbered 26 and 27. The text is A for the 26 and B for the 27.
The convertor itself has also terminals with a text A+ and B- and a ground. Just connect
terminal 26 (A) of the HP with terminal A+ of the convertor and
terminal 27 (B) of the HP with terminal B- of the convertor.
You do not need to connect the ground.
Hello,
I am also trying to communicate with the Therma V with modbus, however without success so far.
Did you have to change some DIP switch settings (Slave mode ?) or change some parameters on the remote control interface ?
I’m just trying with an RS485 / USB interface and a modbus master software before putting HA in the loop.
Yeah set dip 1 in option switch 1 to “ON”.
Further LG peculiarities include mapping holding registers to input register space, so in hass you have to switch input_types to get correct values.
p.s. There are also a lot of registers that can be read outside the documented addresses.
p.p.s. I found an up to date installation manual that had info on R32 version on LG UK site.
p.p.p.s Oh I can’t remember if dip 2 had to be on as well that is the protocol dip. I sat in the cold with my laptop and went through the options, so as it started working, I stopped looking.