Generic Thermostat - Setpoint not changing on actual thermostat

Generic Thermostat - Setpoint not changing on actual thermostat

I’m struggling….
First thing first:
I’m new in HA and have previously used Fibaro Home Center. Step was huge, testing before transforming devices one-by-one over to HA.

In fibaro, there was an “Heat Panel”, linked Thermostat and switch together, as I have a 10 output relay that controlling underfloor heating. The system work actually verry good.

Option in HA is from my knowledge is Generic Thermostat. I have used “sensor.test_kontor_air_temperature” from Thermostat and controlling “switch.relay_control_2”. Changing set temp in HA working nice and relay switch on/of as it should.

climate:
  - platform: generic_thermostat
    name: Test Kontor
    heater: switch.relay_control_2
    ac_mode: false
    min_temp: 15
    max_temp: 35
    hot_tolerance: 0.5
    target_temp: 29
    precision: 0.5
    away_temp: 2
    target_sensor: sensor.test_kontor_air_temperature

The problem is, when changing set temp on Thermostat device (Danfoss DRS21), it would not change the set temp in “climate.test_kontor_4” (Entitet on generic thermostat “Test Kontor”).
There is no link between those device, GT only use the air_temperature from thermostat.

How can I sync temperature between “climate.test_kontor” (Danfoss) and “climate.test_kontor_4” (GT).
Need help to get startet, with eather an event or code. With event, I guess I need to create 2-4 event for each thermostat. I have totally 16 thermostat divided on 2 floor. (each room). Its would be a lot of events…

Aporiticate the time and help to get me starting :grinning :grinning:

I guess the trick would be to capture the Danfoss changing the set temperature and apply it to the generic thermostat via an automation that uses the climate.set_temperature service

Hi and thank you for the suggestion.

I have not manage to get this working. Have google and fight with this for long time now…

alias: Sync Thermostate and climate
trigger:
  - platform: state
    entity_id:
      - climate.vaskerom
      - climate.termostat_vaskerom
    attribute: temperature
variables:
  thermostats:
    - climate.vaskerom
    - climate.termostat_vaskerom
action:
  - service: climate.set_temperature
    target:
      entity_id: '{{ thermostats|reject(''eq'', trigger.entity_id)|list }}'
    data:
      temperature: '{{ trigger.to_state.attributes.temperature }}'

This would not work :confused:

Not sure what you’re trying to achieve. Why not just trigger.entity_id?

What i wanted, is «set_temp» to be sync between climate.vaskerom and climate.termostat_vaskerom.
climate.vaskerom = Thermostat generated true genetic thermostats. This only use temp sensor from climate.termostat_vaskerom.
When I change set temperature, its not changing on climate.termostat_vaskerom (actually thermostat, Danfoss.) And same with Danfoss, set temperature not changing on climate.vaskerom.

You helped me on the way with using climate.set_temperature service.
Problem is, I have limited knowledge and try to fix the problem by my self, referring to similarly topics in forum.

The code was grab from another site, and from my understanding, this was a working code to solve exactly same problem.
But it did not work for me.

Want set temperature to sync between those two thermostats. If I set new temp on Danfoss, climate.vaskerom sets to the same. And same with climate.vaskerom, set new temp to Danfoss.

Ah., I see now. Clever :wink:
No errors in log?

Looks much like what I already achieved (I still need to solve the HVAC state sync):

Error rendering data template: UndefinedError: 'dict object' has no attribute 'to_state

Hi and thank you for replay on this!

Im not sure, if I can use your code to synk set_temp between 1 virtual and 1 actual device.

I have manage ut use climate.group in HACS, but it using average set temp. If virtual have 22, and Danfoss had set to 23, new set_temp would be something like 22,3degrees.
Found a line to replace to not use average, but I did not manage to get that either to work.

I can disable option to change temp on thermostat on wall, but it’s pretty annoying and frustrating when you have the option. Spend a lot of time on research on this, but my limited due to my knowledge. Missing more option when creating event by “dummy’s”.

Is that the entire error message?

It looks like some of it is missing because the word to_state has a leading quote but no terminating quote.

It’s also a puzzling message because the automation uses a State Trigger so the trigger variable should have a to_state property.

Hi,
The error was picked up inside event. But in Core, show follow:

2021-11-18 19:13:16 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'dict object' has no attribute 'to_state' when rendering '{{ trigger.to_state.attributes.temperature }}'
2021-11-18 19:13:16 ERROR (MainThread) [homeassistant.components.automation.tem04_trv_sync_common_room] Sync Thermostate and climate: Error executing script. Error for call_service at pos 1: Error rendering data template: UndefinedError: 'dict object' has no attribute 'to_state'
2021-11-18 19:13:16 ERROR (MainThread) [homeassistant.components.automation.tem04_trv_sync_common_room] Error while executing automation automation.tem04_trv_sync_common_room: Error rendering data template: UndefinedError: 'dict object' has no attribute 'to_state'

That’s an unusual error. I don’t understand why it couldn’t get to_state (unless the automation was manually triggered because then the trigger variable would be undefined).

You have absolutely correct! This error was showing when manually trigged event.

Not sure why or what I have done wrong, but now its working. Feeling pretty stupid…

Cleaned the test page with thermostat and add new ones. After that’s, its fine (“,)
I have to manually wake up Danfoss Thermostat to get changes. It can take up to 5min before the new set temp changed and activate relay. Might also be a reason for I did not see this was working…

Anyhow, thank you all for good help :slight_smile:

1 Like

Ah! When you do that, the automation’s entire trigger section is skipped and so anything in the action that refers to the trigger variable can’t work because it’s undefined.

For future reference, this behavior is mentioned in Troubleshooting your Automation.

Unusual message, though. I would have expected a “None has no attribute…” or similar…