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 · 9 comments

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.

@JarlMorgennebel
Copy link

@Andykakau

I have the same challenge and I am a newbie to HA: Homematic (IP) with desired_temp and actual_temp should control (one-way only) this Smart Thermostat for PID control of floor heating. I only need the temperatures and modes Auto/Off.

Do you mind sharing your working solution?

@Andykakau
Copy link
Author

I make it like this, but only kleines Bad runs.
Configuration.yaml:
https://pastebin.com/JaPQs6Dx

Automation.yaml
https://pastebin.com/724DYWdx

I have an Error, i can not find the solution.

@JarlMorgennebel
Copy link

JarlMorgennebel commented Oct 20, 2024

Hej,

I got my first Homematic IP Thermostat -> HA Smart Thermostat -> Floor heating working fine:

Bildschirmfoto 2024-10-20 um 09 43 59

It's running since three days and has still not adjusted fully to good PID values. I struggled to get the sensors for internal values to show correctly, so I am not sure how I get:

  • Better PID starting values based on the learning process
  • A better visualisation (like the one on this project)
  • A solution for the Template helper for Homematic Legay Thermostats

Thanks, -MN

@Andykakau
Copy link
Author

Andykakau commented Oct 20, 2024 via email

@JarlMorgennebel
Copy link

Hej @Andykakau

I have documented my solution here:

https://github.com/JarlMorgennebel/homelab/blob/main/Home%20Assistant/Smart%20Thermostat%20(PID)/HowTo%20+%20Homematic%20+%20Homematic%20IP.md

I think your issue is with the sensors, but I am not sure - I am using HA since few months only and have not understood everything in detail. Good luck.

@Andykakau
Copy link
Author

Andykakau commented Oct 22, 2024 via email

@Andykakau
Copy link
Author

Andykakau commented Oct 26, 2024 via email

@JarlMorgennebel
Copy link

@Andykakau I have updated my documentation as my last bugs were solved this morning 1:30am...

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

3 participants