#automation to send thermometer temp to thermostat

1 messages · Page 1 of 1 (latest)

dense marten
#

I got a new zigbee thermostat that's able to take the temperature of an external thermometer as the local temp. I want to have home assistant set this value on my thermostat when the thermometer changes.

I'm a bit confused on how I can set the thermometer to the thermostat. The text box shown only allows numerical input so I can't put a variable name (I would imagine it's sensor.bedroom_temp_temperature?)

Let me know if I'm approaching this incorrectly.

Thanks

upbeat canopy
#

A couple things: first, you can’t use templates in device actions. You’d need to delete that action, and add a new one. In the “add action” dropdown, the first option is “device, a great was to start”. It’s actually a horrible way to start. Scroll down further and select “climate”

#

But, it looks like the automation you are setting up is going to set the target temp of the thermostat to whatever your Zigbee thermometer measures. Is that really what you want to do?

#

If your Zigbee thermostat can use an external Zigbee temp sensor, that might be by pairing the external sensor to the thermostat directly

dense marten
#

I have a new idea now though, can I set the calibration to the external - internal?

#

That way, the thermostat is thinking it's the temperature at my probe

upbeat canopy
#

Makes sense to me

dense marten
#

So how would I go about doing that? If i use a climate object, can't I only change the set point?

upbeat canopy
#

Depends on the device and the integration. Probably need to send a Zigbee configuration parameter

dense marten
#

Its this one, the id is number.bedroom_thermo_local_temperature_calibration

upbeat canopy
#

Then you just use a number action in your automation

dense marten
#

Ohh i think i might know from here

#

I was looking at the {{}} yaml objects

upbeat canopy
#

Stuff in curly braces are called templates. That’s what you’ll need to put in the “value” area in my screenshot

dense marten
#

Does this look right?

service: number.set_value
metadata: {}
data:
  value: >-
    {{ sensor.bedroom_temp_temperature -
    state_attr('climate.netatmo_master_bedroom', 'current_temperature') }}
target:
  device_id: db2ea25eec51a974afc2eef31bed944d
  entity_id: number.bedroom_thermo_local_temperature_calibration
#

wait forgot to change the thermostat name lol

upbeat canopy
#

You need the states() function to get the state of your temp sensor, and you have to convert it from a string to a float because all states are strings.

#

You can prove a default value to the float filter to handle cases when the external temp sensor is unavailable. It will just error out without a default. For example
… | float(20) …

#

I’d recommend putting the template into developer tools -> templates to try it out first

dense marten
#

Thank you

upbeat canopy
#

Also, you just need the entity ID as the target. You don’t need the device. If you use the device, it will change every number entity that the device has.

dense marten
#

I think i got it working now

#

Thanks for your help

#
service: number.set_value
metadata: {}
data:
  value: >-
    {{ (states('sensor.bedroom_temp_temperature')|float -
    (state_attr('climate.bedroom_thermo', 'current_temperature')|float -
    states('number.bedroom_thermo_local_temperature_calibration')|float))|round(1)
    }}
target:
  entity_id: number.bedroom_thermo_local_temperature_calibration