Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration of HASmartThermostat with Homematic IP Thermostats and Zigbee Outlet #224

Open
Andykakau opened this issue Jun 30, 2024 · 1 comment

Comments

@Andykakau
Copy link

Hi everyone,

I’m looking to integrate HASmartThermostat 2 into Home Assistant to control my heating. I have Homematic IP thermostats providing the set and actual temperatures. I want to use these with the HASmartThermostat integration to control a Zigbee outlet.

Here is the code I tried:

- platform: smart_thermostat
   name: Kleines Bad Example
   unique_id: climate.hm_tc_it_wm_w_eu_req0837768
   heater: switch.heizung_bad_klein_schalter_2
   target_sensor: sensor.ambient_temperature
   min_temp: 7
   max_temp: 28
   ac_mode: False
   target_temp: climate.hm_tc_it_wm_w_eu_req0837768
   keep_alive:
     seconds: 60
   away_temp: 14
   kp: 50
   ki: 0.01
   kd: 2000
   pwm: 00:15:00

How can I adjust it to properly read values from the thermostat and make it work? Any ideas?

Thanks!

@ScratMan
Copy link
Owner

Hello, you can't set an entity id as target temperature. You need to create an automation in HA that will sync he target temperature between Homematic thermostat and the smart thermostat.

Example:

alias: Example sync thermostats
description: ""
trigger:
  - platform: state
    entity_id:
      - climate.netatmo_couloir
    attribute: temperature
    id: Physical change
  - platform: state
    entity_id:
      - climate.salle_de_bain
    attribute: temperature
    id: Smart change
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - Physical change
          - condition: template
            value_template: >-
              {{ (state_attr('climate.netatmo_couloir', 'temperature') | float)
              != (state_attr('climate.salle_de_bain', 'temperature') | float )}}
        sequence:
          - service: climate.set_temperature
            metadata: {}
            data:
              temperature: "{{ state_attr('climate.netatmo_couloir', 'temperature') }}"
            target:
              entity_id: climate.salle_de_bain
      - conditions:
          - condition: trigger
            id:
              - Smart change
          - condition: template
            value_template: >-
              {{ (state_attr('climate.netatmo_couloir', 'temperature') | float)
              != (state_attr('climate.salle_de_bain', 'temperature') | float )}}
        sequence:
          - service: climate.set_temperature
            metadata: {}
            data:
              temperature: "{{ state_attr('climate.salle_de_bain', 'temperature') }}"
            target:
              entity_id: climate.netatmo_couloir
mode: single

You may also add more triggers and choices to sync the presets, or on/off.
You also need to extract the physical thermostat ambient temperature with a template sensor using {{ state_attr('climate.netatmo_couloir', 'current_temperature') }} that you'll use as target_sensor.

And of course, the physical thermostat should not control directly the heating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants