Bouni / luxtronik

Luxtronik integration for Home Assistant
MIT License
82 stars 13 forks source link

Alpha Innotec #80

Open kubmi opened 5 months ago

kubmi commented 5 months ago

I'd need help with configuration to be able to setup Switch Off and Switch On capability for Heating. Could you pls send me any examples? Thank you, Michal

kbabioch commented 5 months ago

What exactly did you try? What error message are you getting and/or what is (not) happening? Did you try the instructions from the README.md file?

Sorry, but this is not a generic support forum, but an issue tracker for developers. So you should try to be specific with your questions / issues and not just tell us that you need help with something.

kubmi commented 5 months ago

Integration in working fine, I can read a lot of metrics from heatpump. However I couldn't find out how to write the change for sensor. Basically I'm looking for help how to setup heating on and off via Home Assistant. If this is not the right forum, where could I ask? Thx

Bouni commented 5 months ago

@kubmi

All writing to the heatpump is done via a service call. Check out the README secion about it: https://github.com/Bouni/luxtronik#service

kivadiu commented 5 months ago

Hi,

It took me a while to do it and it now works very nicely. For this, you need to add the integration in configuration.yaml:

# https://github.com/Bouni/luxtronik
luxtronik:
  host: 192.168.1.66                    # IP of your luxtronik controller
  port: 8888                            # Port of the controller
  safe: false                           # Enables the writing of unknown parameters if set to false
  lock_timeout: 30                      # Lock timeout for concurrent read- and write operations in seconds
  update_immediately_after_write: true  # Update sensor data after every write operation

Then, you need to define 2 sensors to show the heating and hot water modes:

sensor:
  - platform: luxtronik
    sensors:
    - group: parameters
      #icon: mdi:radiator
      id: ID_Ba_Hz_akt
      friendly_name: "hp_heating_mode"
    - group: parameters
      #icon: mdi:water
      id: ID_Ba_Bw_akt
      friendly_name: "hp_hot_water_mode"

Then 2 corresponding template sensors; they will be used to define switches (only showing On and Off). So everything else than Off is mapped to On:

  - platform: template
    sensors:
      hp_heating_mode2:
        value_template: "{{ states('sensor.hp_heating_mode') }}"
        icon_template: "{{ 'mdi:radiator-disabled' if is_state('sensor.hp_heating_mode', 'Off') else 'mdi:radiator' }}"
      hp_hot_water_mode2:
        value_template: "{{ states('sensor.hp_hot_water_mode') }}"
        icon_template: "{{ 'mdi:water-off' if is_state('sensor.hp_heating_mode', 'Off') else 'mdi:thermometer-water' }}"

and finally 2 switches call the write service to actually update the parameters in the controller (refer to #81 to understand why I set 4 parameters; you may ajust those parameters to your actual heat pump):

switch:
  - platform: template
    switches:
      hp_heating:
        value_template: "{{ not is_state('sensor.hp_heating_mode', 'Off') }}"
        icon_template: "{{ 'mdi:radiator-disabled' if is_state('sensor.hp_heating_mode', 'Off') else 'mdi:radiator' }}"
        turn_on:
          - service: luxtronik.write
            data: { 'parameter': 'ID_Ba_Hz_akt', 'value': 'Automatic' }
          - service: luxtronik.write
            data: { 'parameter': 'ID_Ba_Hz_MK1_akt', 'value': 0 }
          - service: luxtronik.write
            data: { 'parameter': 'ID_Ba_Hz_MK2_akt', 'value': 0 }
          - service: luxtronik.write
            data: { 'parameter': 'ID_Ba_Hz_MK3_akt', 'value': 'Automatic' }
        turn_off:
          - service: luxtronik.write
            data: { 'parameter': 'ID_Ba_Hz_akt', 'value': 'Off' }
          - service: luxtronik.write
            data: { 'parameter': 'ID_Ba_Hz_MK1_akt', 'value': 4 }
          - service: luxtronik.write
            data: { 'parameter': 'ID_Ba_Hz_MK2_akt', 'value': 4 }
          - service: luxtronik.write
            data: { 'parameter': 'ID_Ba_Hz_MK3_akt', 'value': 'Off' }
      hp_hot_water:
        value_template: "{{ not is_state('sensor.hp_hot_water_mode', 'Off') }}"
        icon_template: "{{ 'mdi:water-off' if is_state('sensor.hp_heating_mode', 'Off') else 'mdi:thermometer-water' }}"
        turn_on:
          service: luxtronik.write
          data: { 'parameter': 'ID_Ba_Bw_akt', 'value': 'Automatic' }
        turn_off:
          service: luxtronik.write
          data: { 'parameter': 'ID_Ba_Bw_akt', 'value': 'Off' }

And the result in a dashboard is this:

type: entities
entities:
  - entity: switch.hp_heating
    name: Chauffage
  - entity: switch.hp_hot_water
    name: Eau chaude

image

Duke194 commented 2 months ago

I've written an issue in the python-luxtronik repository to set the types of the proper parameters for Mk1 and Mk2.

https://github.com/Bouni/python-luxtronik/issues/174

would be great if you vote it up so they include them and we can set all of those with "automatic" or "off".