Add Proxon Heating System to HA via Modbus

I would be very interested in your code! Hope you can find a way to share! Great job on the dashboard!

Hope I didn’t forget something
For questions, please ask.

2 Likes

Hallo,

My Homeassistant had problems with the "" in the config but i edited it.
i have one entity i dont know where you generate this, can you chek that please?

sensor.proxon_aktueller_betrieb_template

best regards Jan

This template sensor is included in the configuration.yaml.
I am just using this template to get the names instead of integers.
Means. response is only 0, 1, or 2. But I want to see “heating”, “cooling” or “ventilation” instead.

But I see there is a generell problem. Since I was using “TextEdit” on my MacBook, the file is an “rtf”.
Let me see if I can correct it later today.
==> fixed now

Supid question: How to I add the “Template Climate” to HA? :roll_eyes:

Thank you in advance!

Best regards,

Paul

just put the whole content of the file “climate.yaml” into the configuration.yaml. below the keyword “climate:”
means

climate:
<put here the content>

or you include the file into your configuration.yaml like this.

climate: !include own_files/climates.yaml

I created a folder called “own_files” and put in here the climates.yaml

does this help?

HI Steffen,

thank you for your reply. I am able to use your code from the climates.yaml and I have made a separate yaml file just like you. Also included it in my configuration as described, But you discribe you need to install the addon “template climate” which I think is this one: jcwillox/hass-template-climate: :snowflake:Templatable Climate Device for Home Assistant, Supports Running Actions On Service Calls. (github.com).
that is where I struggle. I get this error when using your code in climates.yaml for living room:

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:238
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 3:16:03 PM (4 occurrences)
Last logged: 3:20:48 PM

[140251746228544] Error rendering data template: ValueError: Template error: int got invalid input 'None' when rendering template '{{ (state_attr('climate.proxon_template_heating_living', 'temperature') | int)*100}}' but no default was specified
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 567, in async_render
    render_result = _render_with_context(self.template, compiled, **kwargs)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2305, in _render_with_context
    return template.render(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/usr/local/lib/python3.11/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 1, in top-level template code
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2003, in forgiving_int_filter
    raise_no_default("int", value)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1625, in raise_no_default
    raise ValueError(
ValueError: Template error: int got invalid input 'None' when rendering template '{{ (state_attr('climate.proxon_template_heating_living', 'temperature') | int)*100}}' but no default was specified

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 362, in async_prepare_call_from_config
    render = template.render_complex(config[conf], variables)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 230, in render_complex
    return {
           ^
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 231, in <dictcomp>
    render_complex(key, variables, limited, parse_result): render_complex(
                                                           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 237, in render_complex
    return value.async_render(variables, limited=limited, parse_result=parse_result)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 569, in async_render
    raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: ValueError: Template error: int got invalid input 'None' when rendering template '{{ (state_attr('climate.proxon_template_heating_living', 'temperature') | int)*100}}' but no default was specified

hmmmm…

is it only for living room? the other ones are working?

Could you please share the code?

What is the value when you check the entity? (Settings->Devices->Entities-> search for exactly this name). Because it seems it is empty. So you need to check the Entity which is written in “current_temperature_template”.

1 Like

Solved! Thanks Steffen! I had a typo in the entity. Your code is helping me a lot setting this whole thing up. I am not such and expert in templates and I am learning a lot! Appreciate your work and sharing!

best regards,

Paul

1 Like

i am interested in getting more information how it works. atm i am thinking about enabling it. but i didn’t get any information how to get it connected directly to my huawei sun inverter. if its not possible, i’ll start tinkering within ha.
another question i have, since i don’t have the fwt connected to the modbus-gateway yet, are there signals about the energy consumption available via modbus? i see empty values in the main panel. that’s why i am wondering. or is it a special feature?

Hi. I am not using a consumption value. It’s not tested, but according to the list it seems you can read out the engine consumption in ampere.

I am reading address 25 (called “Power Total” in the documentation). However, I do not know if it is the real total power consumption of the device.

    - name: "Proxon Power Total"
      unique_id: proxon_power_total
      data_type: int16
      input_type: input
      scan_interval: 15
      slave: 41
      address: 25
      precision: 1
      scale: 0.1
      unit_of_measurement: W
1 Like

@Stroett Thanks for your work, your code helped me a lot in including my heating system to ha. However, even after double-checking my implementation with yours and the official docs, I still can not enable the heating rod in my T300 (address 2001). Although the state changes when writing to that address, neither the power consumption nor the water temperature increases. Also the status register (address 826) still shows the heating rod as disabled.
Anything that I am doing wrong or that I am missing here?

Hi @Kalklas ,
nice to hear that my config is helping you.
Difficult to say what is wrong.
First: Did you change id 2001 or 2003?
To change the value for the heating rod, you have to use ID 2003. 2001 is the status if the rod is activated to not.
The hysteresis is very big. Means you need to increase the value a lot before the rod is activated.
BR Steffen

Both, I set the 2003 register (heating rod approval temperature) to the value of the 2000 register (target temperature) and wrote 1 to the 2001 register that says “E-Heat ON/OFF”. In contrast to the writeable holding register mentioned earlier there is also the read-only input register that says “R4: E-Heat” (Register 826) which I thought is the actual status of the heating rod :thinking:
If the hysteresis is very big for 2003 it might work to set it to way more than (or less?) than the target temperature and then it will enable itself automatically?
Note: I want to enable/disable it to optimize the power consumption by heating the water with the rod if there is “too much” solar energy.

you are right … sorry.
826:
Is the status if the rod is active or not. it is a binary sensor

- binary_sensors:
    #T300
    - name: "Proxon Heizstab Status"
      unique_id: proxon_heizstab_status
      scan_interval: 5
      slave: 41
      address: 826
      input_type: input

2001:
This is the switch if the rod is allowed to be activated

 - switches
    #T300
    - name: "Proxon Heizstab"
      unique_id: proxon_heizstab
      slave: 41
      address: 2001
      scan_interval: 5
      verify:
        delay: 1

2003:
for the heating temperature

- sensors
    - name: "Proxon Heizstab Temperatur"
      unique_id: proxon_heizstab_temperatur
      scan_interval: 5
      slave: 41
      address: 2003
      input_type: holding
      scale: 0.1
      precision: 1
      unit_of_measurement: °C
      data_type: uint16

I am using the following automation to change the temperature

alias: Slider Heizstabtemperatur einstellen
description: ""
trigger:
  - platform: state
    entity_id: input_number.proxon_sollwert_freigabe_heizstab_slider
condition: []
action:
  - service: modbus.write_register
    data:
      slave: 41
      address: 2003
      value: >-
        {{ (states('input_number.proxon_sollwert_freigabe_heizstab_slider') |
        int)*10 }}
      hub: proxon
mode: single

just remove the trigger and write in the action directly the value *10 (I am reading it out from a slider)

alias: test
description: ""
trigger: null
condition: []
action:
  - service: modbus.write_register
    data:
      slave: 41
      address: 2003
      value: 650
      hub: proxon 
mode: single

you need to change the “hub” name to yours. This should set the temperature of the heating rod to 65°C. You can check it also in the proxon app.

2 Likes

Thanks a lot for your help, it is working now :+1:

I have a question which is slightly off topic. I got the heat system this month and I use the app and I want to make it local. For now, I am not comfortable connecting anything such Modbus.
Has anyone tried to implement API calls to control the system? I tried to listen to the communication and I only got a few links and since it’s probably encrypted I won’t be able to get much info without the devs providing the documentation. I only got this link https://phc.proxon.de/ which is useless, but I will try mu luck this way.
Anybody tried similar way to include this heating system in HA?

Hello there,

I’m also in the progress of implementing the PROXON via Modbus into HomeAssistant.
As beginner, I tried step by step, with all of this usefull information here.
But I’m not getting this up and running.

I’m using the Waveshare Rail-Mount Serial Server RS232/485/422 to RJ45 Ethernet Module POE.
The Module is up and running. available in the Network and the Link LED is blue.

@eX2x gave a advice to connect HA over SSH.
Connect to your homeassistant over ssh and try if you can reach ip adress with ping and port with nc -w 3 -v 192.168.20.4 502 if this returns 192.168.20.4 (192.168.20.4:502) open then you can reach the tcp port from homeassistant. That means the network connection is not the problem.
I got a open back. Should be fine from this side.

I configured the configuration.yaml with just a simple snap:
*# PROXON *
modbus:

    • name: proxon*
  • type: tcp*
  • host: 192.168.x.x*
  • port: 502*
  • sensors:*
  •  - name: "Proxon Lüfterstufe"*
    
  •    unique_id: proxon_luefterstufe*
    
  •    scan_interval: 15*
    
  •    slave: 41*
    
  •    address: 22*
    
  •    input_type: holding*
    
  •    data_type: uint16*
    

But not getting data. Tells me not available.

I also used the - Modbus master - Tool.
Here it tells me: Connection state: Connected
BUT gives me continously Errors: Block with function4 gives an IOException: Unable to read data from the transport connection.
I’m not sure if its just wrong settings or really an bigger issue.

485A & B (and ground) should be correct conneced to X6 on the proxon Platine.
To get sure I just changed them, but no effect.

Thats my actual status.
Now my hope is to get some help here. :slight_smile:

Anything else of information needed?

Thanks and regards

@JAD, just for my interesst: the both LEDs direct to the X6 port, do they light up?

I’m still stuggeling to get data via the X6 port and observed that the green/yellow LED (direct next to the X6 port) just slightly and dim flickers. Not such strong as all other LEDs on the board.

Is there anything I need to activate from the Proxon side to enable data transmission?I used EIB/KNX cabeling is this correct? I expected. Will try today CAT7 cable.