I have an Ecobee thermostat in my house and a few window a/c units. Some units are smart out of the box, some are controlled with a z-wave receptacle and a virtual thermostat in HA. I want to be able to control all the a/c units from my Ecobee to make it easier to have the whole house the same temp without everybody in my house having to go into HA. I want to to work like I had central air connected to my Ecobee. I know ecobee has a stupid slow polling time, but I’d like to try it out.
So basically I want to have an automation trigger if the ecobee thermostat temp is not the same as another thermostat temp along with a few conditions.
Here is what I came up with. Doesn’t seem to work, but doesn’t seem to give errors.
#Set a/c temps to same as Ecobee
- alias: 'Set A/C Temps'
initial_state: true
trigger:
platform: template
value_template: "{{ state_attr('climate.thermostat', 'temperature') != state_attr('climate.living_room_ac', 'temperature') }}"
condition:
- condition: state
entity_id: climate.living_room_ac
state: 'cool'
- condition: state
entity_id: climate.thermostat
state: 'cool'
action:
- service: climate.set_temperature
data:
entity_id: climate.living_room_ac
temperature: 80
As of right now I am just using 80 degrees as a simple test and will have to figure out how to make a template for that probably once I get the trigger working.
I am quite the noob when it comes to templates so I’m sure something is not written right.
Looks like it should work. The main problem is, you’re not setting climate.living_room_ac to the set temperature of climate.thermostat, so the expression in the trigger will not go back to False. Note that a template trigger will only “fire” again if the expression evaluates to False, and then back to True.
You might want to change the action to this:
action:
- service: climate.set_temperature
data_template:
entity_id: climate.living_room_ac
temperature: "{{ state_attr('climate.thermostat', 'temperature') }}"
Thanks for the feedback. I will have to play with it more. I added your suggested template for the action and though maybe if I rebooted it would help. I did check config and it said it was good and rebooted and now it won’t come back up. I’ll have to check it out more when I get home and see what happened, but I can access anything I need to, to fix it from work.
Ok so I got home and my HA was working fine, just couldn’t log in from the cloud. I rebooted and it was all good. Finally got a little time to mess with it today on my lunch break. I added in the template action step and took out the conditions and it works now. I figured out my problem was that the generic thermostat when it isn’t calling for cool has a state of idle and not cool like my ecobee does. So I had to make my conditions an and/or and add the state of idle into it.
#Set a/c temps to same as Ecobee
- alias: 'Set A/C Temps'
initial_state: true
trigger:
platform: template
value_template: "{{ state_attr('climate.thermostat', 'temperature') != state_attr('climate.living_room_ac', 'temperature') }}"
condition:
condition: and
conditions:
- condition: state
entity_id: climate.thermostat
state: 'cool'
- condition: or
conditions:
- condition: state
entity_id: climate.living_room_ac
state: 'cool'
- condition: state
entity_id: climate.living_room_ac
state: 'idle'
action:
- service: climate.set_temperature
data_template:
entity_id: climate.living_room_ac
temperature: "{{ state_attr('climate.thermostat', 'temperature') }}"
No I just have to figure out what I want to do with this if they do get out of sync like over the winter or something. I could take the conditions out, or maybe make an automation so when the ecobee is switched to cool it syncs the temps.
Before you get too far, you might want to wait to do any major changes/improvements to this and related automations since the climate component is going through some major changes. I don’t know all the details, but I believe you should see the differences starting in 0.96.
Hmm… interesting. Are you able to divulge any of these changes as to how they would affect my automations? Or is it just that the work of making them might not be needed after the update?
In 2 week my wife and I are going on vacation and my parents are staying at our house to watch our dogs. I will probably take a little of time to do 1 or 2 more automations just to make it easier for them to operate the a/c in the house. I haven’t gotten to the point yet of having a control panel or anything accessible in the house that not on my phone or computer.
I’m not really involved with the changes. I’ve only seen that a concerted effort is being made to get the changes done for the 0.96 release. Not knowing what they are I can’t really comment on how they might affect your automations, or if they even will. Just wanted to give you a “heads up”. Worst case, just don’t upgrade to 0.96 until you have the time to deal with any breaking changes.
Thank you for the info and the help!