Home Assistant Community

Possible to break out items in climate?

#1

So basically I have my 2GIG CT100 thermostat showing up, and this is what things currently look like:

I’m very new to HA (in fact, yesterday was the first time I touched the configuration.yaml file), and I’ve come a long way after discovering groups. Currently, I have an HVAC group with:

group:
  hvac_downstairs:
    name: 'HVAC (Downstairs)'
    entities:
      - climate.thermostat_downstairs_cooling_1_2
      - sensor.thermostat_downstairs_temperature_2
      - sensor.thermostat_downstairs_relative_humidity_2_3

and while it gets the job done, I would rather breaking out Target Temperature, Operation, and Fan Mode to the main page, instead of having to click on Settings and using the popup. Can someone help point me in the right direction to achieve this?

I’ll admit that I tried doing this:

group:
  hvac_downstairs:
    name: 'HVAC (Downstairs)'
    entities:
      - climate.thermostat_downstairs_cooling_1_2.target_temperature
      - climate.thermostat_downstairs_cooling_1_2.operation
      - climate.thermostat_downstairs_cooling_1_2.fan_mode
      - sensor.thermostat_downstairs_temperature_2
      - sensor.thermostat_downstairs_relative_humidity_2_3

But obviously it didn’t work. I’m not sure how Entity Attributes work, if that’s what these are even called? Any help is greatly appreciated!

More Simple Thermostat Control?
#2

@tycoonbob
The best way to go about this is to create a groups. yaml page. At the top add the default_view: then you can create your groups below that. To add groups and entities to the front end you have to add them to the default view. Check these out https://home-assistant.io/topics/splitting_configuration/

Here is an example…

Add the entities you want to break out directly to the default view. (They don’t have to be groups.)

You can also create more views (tabs).

#3

Thanks for the reply @PtP.

I may not have been super clean in my question, as I have a couple groups already created with success. Here is a screen shot from @jbardi that I found this morning. He has setup exactly what I’m looking to do:

See how he has Operating Mode, Fan Mode, and Set Target Temp? That’s what I’m wanting.

It looks like he posted his group settings, and here are the relevant parts:


Thermostat:
  entities:
    - input_select.hvac_mode
    - input_select.hvac_fan_mode
    - input_slider.set_temp
    - sensor.target_temp
    - sensor.ct100_thermostat_temperature_8
    - sensor.inside_humidity

But I’m not sure how he created the input_select and input_slider entities. Seems he’s also using a 2GIG CT100 thermostat, so that’s promising. Maybe @jbardi would be kind enough to share?

Paging @jbardi. :slight_smile: :slight_smile:

#4

Ok got ya. You need to make sensors out of sensors using template sensors. https://home-assistant.io/components/sensor.template/

Good luck!

#5

@PtP

So I’m guessing I need to create an input_select key and list my options (Cold, Heat, Off) and then use a template sensor with if statements, something like:

if input_select.havc_downstairs = Cold, set state.climate.thermostat_downstairs_cooling_1_2.attributes.operation_mode = Cool
elif input_select.hvac_downstars = Heat, set state.climate.thermostat_downstairs_cooling_1_2.sttributes.operation_mode = Heat
elif input_select.hvac_downstairs = Off set state.climate.thermostat_downstairs_cool_1_2.attributes.operation_mode = Off
endif

At least, that’s the logic that comes to my mind. I would love to see @jbardi’s setup on this. :slight_smile:

#6

So here’s what I’ve got so far, but it’s not working as expected:

input_select:
  hvac_operation_mode:
    name: 'Operating Mode'
    options:
      - 'Cool'
      - 'Heat'
      - 'Off'
    initial: Cool
    icon: mdi:air-conditioner
automation:
  - alias: 'Set thermostat operation_mode based on input_select'
    trigger:
      platform: state
      entity_id: input_select.hvac_operation_mode
    action:
      service: climate.set_operation_mode
      entity_id: climate.thermostat_downstairs_cooling_1_2
      data_template:
        operation_mode: '{{ states.input_select.hvac_operation_mode.attributes.options }}'
  - alias: 'Set input_select based on thermostat operation_mode'
    trigger:
      platform: state
      entity_id: states.climate.thermostat_downstairs_cooling_1_2.attributes.operation_mode
    action:
      service: input_select.select_option
      entity_id: input_select.hvac_operation_mode
      data_template:
        options: '{{ states.climate.thermostat_downstairs_cooling_1_2.attributes.operation_mode }}'

The first automation rule is to set operation_mode of climate.thermostat_downstairs_cooling_1_2 based on what was selected in input_select.hvac_operation_mode.

The second automation rule is to set option of input_select.hvac_operation_mode based on what the current status of states.climate.thermostat_downstairs_cooling_1_2.attributes.operation_mode is, in an attempt to keep the two synced up (in case I was to adjust the thermostat manually).

Unfortunately, one is not adjusting the other as expected. :frowning:

#7

Updated previous post with update automation rules.

When watching the log files, it doesn’t appear that my automation rules are triggering. In fact, I see nothing in my logs to make me think automation is working (no errors, just no mention of automation). Maybe my triggers are wrong? Are there any package pre-reqs required for automation to work that I may have missed?

Any help is greatly appreciated!

#8

@tycoonbob Interested in what you’re trying to accomplish, I will try it myself. Are you trying to display the actual mode the Thermostat is operating at the time? or to show the mode that is set to?
Those are two different parameters. I’m interested in tracking if the Thermostats is actually running or not, this is the zwave Id: CommandClass id=“66” name=“COMMAND_CLASS_THERMOSTAT_OPERATING_STATE”

#9

On your Automation yaml, try this, it does seems to work for me:
data_template:
operation_mode: “{{ states(‘input_select.hvac_operation_mode’) }}”

#10

Thanks for the response @RABCbot.

So basically, here is what I’m trying to accomplish. Currently, I have to click on my thermostat widget which has an additional popup window, which is where I’m able to set my Target Temperature, Operation (mode) and Fan Mode. While this works just fine, I don’t like having to click on the widget and bring that up to make changes.

So, I’ve created a group called HVAC where I want to have an input_select which will set my thermostats operation mode (Cool, Heat, Off), another input_select that will let me set the fan mode (auto, on), and an input_slider that will let me set my Target Temperature.

In trying to figure this out, my currently config (shown in post #6) has an input_select entity that lists 3 options; Cool, Heat, and Off. Basically, I want to be able to select Cool, and make my thermostat switch it’s operation mode to Cool. If I select Heat in my input_select, I want the thermostat operation mode to be set to Heat.

The reason for my second automation rule is to set the input_select field to whatever the thermostat is set to, in the even that the thermostat was change. While the first automation rule will set the thermostat operation mode based on what the input_select is set to, I want to make sure that I can change the thermostat manually (from the thermostat), while having the input_select update (because it detected a change in the thermostat’s operating mode), so it doesn’t override my manual change.

Does that make sense? Post #3 shows a screenshot that @jbardi shared in another post, which basically shows EXACTLY what I’m trying to accomplish. The picture in my first post (click on it to see the full picture) shows the popup widget, or whatever it’s called, that works but I don’t like.

Hope that helps!

#11

So I finally got all this working like I wanted! Had a few helpful things come across in Gitter that pointed me in the right direction, and a couple hours later it’s setup.

I will share my configs later today/tomorrow once I have a chance to clean them up a bit.

1 Like
#12

Hey, sorry for not getting back with you on this issue. I’ve been out of town and tied up with some things. Glad you got it figured out. Would love to take a look at your configs. There is more than 1 way to skin a cat, and you may have a more robust setup than me that could make it more efficient :smiley:

#13

@jbardi It’s all good, and I appreciate you stopping by. It took me about 3 days, this post, a reddit post, and about 2 hours on Gitter to finally get it all the way I wanted, haha.

Here is what mine currently looks like from the frontend:

Here are my relevant configs (group, automation, input_select, and input_slider):

group:
  hvac_downstairs:
    name: 'Downstairs'
    entities:
      - input_select.hvac_operation_mode
      - input_select.hvac_fan_mode
      - input_slider.hvac_target_temp
      - sensor.climate_downstairs_temperature
      - sensor.thermostat_downstairs_temperature_2
      - sensor.thermostat_downstairs_relative_humidity_2_3

  hvac:
    name: HVAC
    view: yes
    entities:
      - group.hvac_downstairs

input_select:
  hvac_operation_mode:
    name: 'Operating Mode'
    options:
      - 'Auto'
      - 'Cool'
      - 'Heat'
      - 'Off'
    initial: Cool
    icon: mdi:settings
  hvac_fan_mode:
    name: 'Fan Mode'
    options:
      - 'Auto'
      - 'On'
    initial: Auto
    icon: mdi:fan

input_slider:
  hvac_target_temp:
    name: 'Set Target Temp'
    min: 55
    max: 90
    step: 1
    initial: 70

automation:
  - alias: 'Set thermostat operation_mode based on input_select'
    trigger:
      platform: state
      entity_id: input_select.hvac_operation_mode
    action:
      service: climate.set_operation_mode
      entity_id: climate.thermostat_downstairs_cooling_1_2
      data_template:
        operation_mode: "{{ states('input_select.hvac_operation_mode') }}"
  - alias: 'Set input_select based on thermostat operation_mode'
    trigger:
      platform: state
      entity_id: climate.thermostat_downstairs_cooling_1_2
    condition:
      condition: template
      value_template: '{{ trigger.to_state.attributes.operation_mode != trigger.from_state.attributes.operation_mode }}'
    action:
      service: input_select.select_option
      entity_id: input_select.hvac_operation_mode
      data_template:
        option: '{{ states.climate.thermostat_downstairs_cooling_1_2.attributes.operation_mode }}'
  - alias: 'Set thermostat fan_mode based on input_select'
    trigger:
      platform: state
      entity_id: input_select.hvac_fan_mode
    action:
      service: climate.set_fan_mode
      entity_id: climate.thermostat_downstairs_cooling_1_2
      data_template:
        fan_mode: >-
            {% if is_state('input_select.hvac_fan_mode', 'Auto') %}
                Auto Low
            {% elif is_state('input_select.hvac_fan_mode', 'On') %}
                On Low
            {% endif %}
  - alias: 'Set input_select based on thermostat fan_mode'
    trigger:
      platform: state
      entity_id: climate.thermostat_downstairs_cooling_1_2
    condition:
      condition: template
      value_template: '{{ trigger.to_state.attributes.fan_mode != trigger.from_state.attributes.fan_mode }}'
    action:
      service: input_select.select_option
      entity_id: input_select.hvac_fan_mode
      data_template:
        option: >-
            {% if is_state_attr('climate.thermostat_downstairs_cooling_1_2', 'fan_mode', 'Auto Low') %}
                Auto
            {% elif is_state_attr('climate.thermostat_downstairs_cooling_1_2', 'fan_mode', 'On Low') %}
                On
            {% endif %}
  - alias: 'Set thermostat temperature based on input_slider'
    trigger:
      platform: state
      entity_id: input_slider.hvac_target_temp
    action:
      service: climate.set_temperature
      entity_id: climate.thermostat_downstairs_cooling_1_2
      data_template:
        temperature: "{{ states('input_slider.hvac_target_temp') }}"

So as you can see, there are 5 automation rules. The first two are for setting the Operating Mode based on the first input_select, the second two rules are for setting the Fan Mode based on the second input_select, and the fifth rule is for setting the target temperature with the input_slider.

  • The first rule sets the thermostat operating mode based on the input of the input_select.
  • The second rule sets the input_select based on the setting of the thermostat, in the event the operating mode was changed manually from the thermostat.
  • The third rule sets the thermostat fan mode based on the input of the input_select (similar to rule #1).
  • The fourth rule sets the input_select based on the setting of the thermostat, in the event the fan mode was changed manually from the thermostat (similar to rule #2).
  • The fifth rule sets the thermostat target temperature based on the input of the input_slider.

I originally had a sixth rule that would set the slider if the temp was manually set, but I found that this caused a loop. Since the slider doesn’t display a value unless you tap on it, I figured there was no point in this rule, and instead added the “Target Temperature” sensor below the slider to show was it was currently set to. In fact, my group looks exactly like yours. :smiley:

So how similar is this to your setup, @jbardi?

11 Likes
#14

Mine is exactly like yours in fact… guess there aren’t too many ways to do this setup in the long run lol

I do however have the rule to change the slider when the temperature is changed manually on the thermostat. I also had the loop issue going on, because when I had it change the slider to match the temperature I manually set, it would trigger the slider to set the temperature which was already set in the first place, and on and on, but this was resolved by simply adding a condition to the automation for the slider so that the slider will only call climate.set_temperature if the slider’s new value is not already equal to the temperature attribute on the thermostat.

#15

I don’t know why I didn’t think about adding a condition on that rule to stop the loop. Even though I don’t really need it, I’ll likely go back and add that rule back with a condition. Otherwise my OCD won’t be happy, haha.

#16

Yeah, like you said, it is not necessary, but it is a little jarring when I go to change the slider and the number that pops up in the bubble is like 5 degrees different than the actual temperature is, also, I like to think of the slider as a direct link to the hardware, so without it being tied directly to the change, it just feels broken. I just like everything to be tied on all sides to all changes so there is never a question as to what the temperature is.

Also, in future, who knows if they may change the slider so that it always shows the temperature instead of only when you tap on it, so this way you are future proofing your layout :smiley:

One more thing, I’m not sure if you noticed this or not with the CT100 (but from what I gather this applies to all Z-Wave Thermostats), you can change the temperature manually on the thermostat even if the Operating Mode is set to Auto, but Z-Wave can not, and therefore Home Assistant can’t either, so if you have your Operating Mode set to Auto and you move the slider to change the temperature, the slider will reflect the new temperature, but the thermostat will not actually change temperature, so the Target Temperature will still show the old value.

Currently in my slider automation, not only am I making sure the new value is not the same as the thermostats temperature attribute, but I am also checking if the Operating Mode is set to Auto, and if it is, I set the slider back to the old value. So visually, you will move the slider, and it will just snap back to the where it was before. This lets me know that I have to change the operating mode to either Heat or Cool before I can use the slider to change the temperature. It is a little annoying though, because if it is in Auto mode, I have to change it to Heat or Cool, then change the temperature, and finally change it back to Auto.

A better workaround for me to avoid having to do 3 steps in order to change the temperature in Auto mode, is that I am going to remove the “Auto” option from the Operating Mode input_select and then programmatically create my own auto mode instead of using the Auto mode of the thermostat. I will do this by checking the current temperature, and if the target temperature I am setting it to is higher than the current temperature, I am going to make it first set the Operating Mode to Heat, and then change the temperature. And if the target temperature I am setting is lower than the current temperature, i am going to make it change the Operating Mode to Cool and then change the temperature.

Then I will have an additional automation monitoring the actual temperature, and if it goes above the target temperature and the current Operating Mode is Heat, it will change it to Cool, and if the actual temperature drops below the target temperature and the current Operating Mode is Cool, I will have it change to Heat.

It is a bit more work, basically recreating an entire Auto mode, but again, I like to be thorough and make everything work completely with each other in all scenarios :slight_smile:

#17

Sharing my configs via github, for anyone interested. Seeing a bit of traffic/likes on this thread, so maybe they will help someone.

6 Likes
#18

Using switch templates, got effect wanted, using templates I don’t need to set up automations and all is pack in one component.
sharing my templates: template_switches.yaml (4.1 KB)

1 Like
#19

I noticed that you were having trouble with the input_slider (target temp. has issues as well) updating when the temperature is changed on the HVAC unit.

I do not know if this is your case, but in my case I noted several entity_id’s for the HVAC system; i.e.: “/_thermostat_cooling_1_2_2…”, “/_thermostat_heating_1_2_1”. Since I used the ‘cooling’ entity as my main entity for the automation it was not updating when change was made on the HVAC unit, yet did notice that the target temperature on the ‘heating’ entity did update.

What I did was create a template to get the target temp., then triggered the automation for the slider based on the value of the template’s state.

Here is my sensor and my automation for the slider.

- platform: template
  sensors:
    thermostat_tartemp:
      value_template: >-
        {%- if is_state('input_select.hvac_operation_mode', 'Heat') -%}
            {{ states.climate.honeywell_th8320zw1000_touchscreen_thermostat_heating_1_8_1.attributes.temperature }}
        {%- elif is_state('input_select.hvac_operation_mode', 'Cool') -%}
            {{ states.climate.honeywell_th8320zw1000_touchscreen_thermostat_cooling_1_8_2.attributes.temperature }}
        {%- endif -%}


#Set input_slider.hvac_target_temp to that of the HVAC Unit
- alias: 'Set input_slider.hvac_target_temp to that of the HVAC Unit'
  trigger:
    platform: state
    entity_id: sensor.thermostat_tartemp
  condition:
    condition: template
    value_template: '{{ states.sensor.thermostat_tartemp.state != states.input_slider.hvac_target_temp.state }}'
  action:
    service: input_slider.select_value
    data_template:
      entity_id: input_slider.hvac_target_temp
      value: '{{ states.sensor.thermostat_tartemp.state }}'
2 Likes
#20

@jfontestad Thanks for sharing your Thermostat automation, I finally used in my config, instead of using an input_slider, I used a input_select, it works as advertised!
Only problem I have is restarting home-assistant, the initial values on the input_select are not the same as the sensors. I guess because the automation has not trigger yet. Any ideas how to update the values after hass is reinitialized?
of course, if later on the sensors are updated, the change is reflected properly on the input_select
thanks again!