Get target_temp (generic_thermostat) from actual thermostat

No. Tried restarting but it threw parsing errors:

while parsing a flow mapping in “/config/configuration.yaml”, line 101, column 26 expected ‘,’ or ‘}’, but got ‘’ in “/config/configuration.yaml”, line 101, column 107

Good idea though!

Hi you dm’d me about doing this with an automation as your template wasn’t resolving.

An automation like this should copy the set temperature from the physical thernostat to the virtual one whenever it changes.

mode: single
trigger:
  - platform: state
    entity_id: climate.physical_therm
    attribute: temperature
condition: []
action:
  - service: climate.set_temperature
    entity_id: climate.virtual
    data: 
      temperature: {{ state_attr('climate.physical_therm', 'temperature') | int }}

Templates aren’t my strong suit, but that should be close. Obviously need to use the names of your real entities

I really do appreciate your answer. Thanks. The logic works, but everytime I create an automation with it the code disappears. it is really weird.

I got it working! After a lot of restarts, trying to debug code, it looks like there is a config that works. No don’t touch anything!!! :smiley:
Thanks alot for your help.

1 Like

I know it’s been a while, FizCarloz, but do you want to share the solution that ultimately worked for you?

Of course I will share information. I never got the above solution to work unfortunately. Something about the syntax or code that just didn’t work.
I ended up creating an automation that changes the temperature whenever the physical temperature on the thermometer changes. That left me with a entire gui approach with no code. Which in hindsight might be better if someone else is to debug. But defintely not a “tinkering” solution :slight_smile:

Hope that helps

Thanks for the reply!

I managed to get it working since my last post. The sensor template in this post gave me what I needed.

In my configuration.yaml:

sensor: !include sensors.yaml

In sensors.yaml:

- platform: template
  sensors:
    fireplace_temperature_attribute:
      friendly_name: "Fireplace Temperature Attribute"
      unit_of_measurement: 'degrees'
      value_template: "{{ state_attr('climate.fireplace', 'temperature') }}"

That allows me to dynamically set the fireplace thermostate setpoint with a Service Call (I’m using Node-RED in my case):

It also allows me to get the fireplace thermostat setpoint with a State node:

Together, this lets me have two setpoints: one for daytime, and one for nighttime. When it’s daytime, the main fireplace thermostat syncs with the daytime setpoint. When it’s nightime, it syncs with the nighttime setpoint:
2022-01-15_23-08-18

Wow, that is really a cool solution. I’ll see if I can give it one more try to achieve similar. I’m able to do the same although my solution is a bit more cumbersome than yours. Also i havent used Node RED before. Looks cool.

//F