Input_select and input_slider Help Please

I tried the template tester again to see if I could come across what returns the value of the sliders current set point. I know it is set at 72.0 and when I look at the entity list for it I see:

Entity ID: input_slider.hvac_target_temp
State: 72.0

State Attributes:
{
  "friendly_name": "Set Target Temp",
  "max": 85,
  "min": 65,
  "step": 1
}

But when I try anything with the input_slider in a template, for example:

{{ input_slider.hvac_target_temp }}

I get an error:

Error rendering template: UndefinedError: 'input_slider' is undefined

Clearly, itā€™s not undefined as it has a value according to the entity list but I donā€™t know enough to understand how to pull that value out in a template and compare it to the current set point on the thermostat.

I got to shut the work down for the night as I need to get to bed. Oā€™dark thirty comes early tomorrow New Years Day or not and I donā€™t believe telling work I overslept because I was working on my home automation will carry much weight as an excuse.

Okay, I had a thought before going to bed and tried something and I think I got it:

{{ states.input_slider.hvac_target_temp.state }}

This returns the temperature setting of the input slider. So now the question remains, how do I compare that to the thermostat set point and change the input slider to match that of the thermostat?

I think you have all the pieces. I havenā€™t done much with templates, so this is a guess.

value_template: ā€˜{{ trigger.to_state.attributes.temperature != states.input_slider.hvac_target_temp.state }}ā€™

Iā€™m not sure about how to set the value of the input slider through a template.

I think I am close, I just got to figure out how to check the difference, then use that information to adjust the input slider to match the thermostat.

So here is my thought process, and I apologize if my posts are annoying long. I try to post how I proceeded through things so that if I goof someone can point out where my logic went wrong and why I came to the wrong answer. So, that said:

states.climate.trane_model_tzemt400ab32maa_heating_1_34_1.attributes.temperature

Returns back the set point temperature of the thermostat. Whereas:

states.input_slider.hvac_target_temp.state

Returns the value of the input slider position.

The input slider should change the set point of the thermostat, which it does, but it also needs to get the set point from the thermostat and update its position to that of the thermostat should they differ. So that leads me to think that you have the order correct in your value template statement and it therefore should look like this:

{{ states.climate.trane_model_tzemt400ab32maa_heating_1_34_1.attributes.temperature != states.climate.trane_model_tzemt400ab32maa_heating_1_34_1.attributes.temperature }}

One would ā€˜thinkā€™ that if that were put into the template editor it would return true or false depending on whether or not the two differed. However, when I tried this, it was always returning one or the other (I tested this last year, how long do you expect me to remember, LOL) whether or not they were the same or not.

I believe I was also able to get the to and from states working. The little notes I wrote down show:

{{ states.input_select.hvac_target_temp.to_state != states.input_select.hvac_target_temp.from_state }}

That I do not recall now what kind of return I got on that (again, this was last year, LOL) I just recall it was not giving me any errors.

So, at this point I hope someone can come along and give me whatever missing piece(s) there are because I am at a point I am not sure what else to do or how to do it.

That said, I do want to say @turboc, thank you immensely for your help thus far. I try to put forth the effort so that anyone comes along sees that I am not trying to just get it done for me, I want to figure it out also so I can, at some point, stand on my own with this. Though, doing all this, leaves me wishing the HA developers would have used Python as the configuration language as well. It seems like it would have been so much easier, far more resources in which to draw from, etc. But then again, how many people would have tried HA if it were Python instead of Yaml.

Anyway, I will leave this here until later today when I get off work.

OMG, you know Python, install AppDaemon. Itā€™s an addon to HA and gives you a python interface for doing this.

I donā€™t know Python, at least not to the level that I could write my own stuff. I have studied it from time to time because I like the language, I just never became proficient in it. I just know there are a ton of resources out there that I can draw and learn from. Yaml, not so much.

That said, I did set up HA, OZW, and OZWCP on a Linux Mint box and have all that working and I have installed AppDaemon there. The intent being that I could use that as a testing environment. My plan is to convert the Pi over to AppDaemon as soon as I can and am comfortable with using it.

I just need to figure out how I am going to use a test environment to practice on a production environment since there is only one Aeontec Z-Stick and I canā€™t pair the zwave devices to more than one stick.

yea, having a test box running with limited resources, and against the same lights as a production box is running against can get a bit confusing. The sad thing is, I have automation in AD that compares physical to HA and updates HA to match physical if needed, which is basically what you are trying to do. LOL

DUDE! Seriously? Ugggg. LOL.

I guess I am going to have to rethink my approach then.

I have a problem with my kids coming down at night and leaving the lights on. So I have a timeout set for the lights. The way it works though is to have an input_slider in HA that sets the time the timeout feature is activated at night and what time in the morning it turns off. So at that point, Iā€™m just reading the input_slider. But when HA reboots, the sliders default back to another value that may not be correct, so anytime the sliders are changed, I write the new value out to a json file. Then when AD or HA restart, I read that file and update the HA input_slider to match what we read from the file. (telling HA to update itā€™s slider to match reality).

Okay bud, donā€™t give up on me. Let me get at least the very basic functionality working for the HVAC so I can at least see what is going on with the thermostat and change it if absolutely necessary and I will back up and punt. Your way sounds a whole lot better and possibly much easier to implement.

Let me start reading my stuff on AppDaemon and try to get some understanding of it and try to join your world of automation.

No problem. If you have any questions on AD, there is a very active group of people that monitor the 3rd party app section of this board that can answer any questions you have. Iā€™ll be happy to help out as well of course.

1 Like

Okay, I have pretty much given up on this. However you get to input slider to read an integer value from a zwave device has escaped all my attempts. So for the benefit of whoever finds this post, it is unsolved. Iā€™d post all the things I tried in case someone could use it to learn or build from but that would be a bit of work.

Thanks for everyone who helped out and tried, especially @turboc for his patience while I tried things out.

Hi all,
Iā€™m running into what seems to be a similar issue: I have multiple climate units (EQ3 bluetooth thermostats) and Iā€™m trying to sync them up: basically, I want to have a slider which I slide to any given value (between 15 and 25) and then it sends that value to the thermostats. Iā€™m able to control the thermostats using

service: climate.set_temperature
data:
  entity_id: climate.bedroom
  temperature: 17

So for when I leave in the morning, I can set it to a predefined value. But what I would like, is something like this:

service: climate.set_temperature
data:
  entity_id: climate.bedroom
  temperature_template: {{ states('input_slider.slidermastertemperature') }} 

but as you may have guessed itā€¦ it doesn work. Any other suggestions, perhaps? Iā€™ve also tried

data_template:
  entity_id: climate.bedroom
  temperature: {{ states('input_slider.slidermastertemperature') }} 

but to no avail.

Any help is highly appreciated. Thanks!

Good Luck! I never was able to get my slider to read changes from the climate control unit itself. I know it can be done, but was never able to get it to work.

I had a similar issue. My thermostats are VERY picky and require some skill to put it all in templates - long story, but anyway, I wanted to display unique values from the system on the front end. I did that, but wanted a slider to control the temperature setting too.

What I did was simply create sensors for the values I wanted to display (temp, fan state, etc.) and I used the temp sensor I created as the entity for my slider automation which updates the input slider value to match whatever the temp changes to.

Like so:

Here is the slider that controls the downstairs heat:

## Downstairs Heat
downstairs_heat:
  name: "Downstairs Heat"
  initial: 69
  min: 60
  max: 89
  step: 1

This first automation sends the slider value to the thermostat:

- alias: downstairs hvac temperature adjustment
  trigger:
    platform: state
    entity_id: input_slider.downstairs_heat

  action:
    - service: climate.set_temperature
      data_template:
        entity_id: climate.2gig_technologies_ct101_thermostat_iris_heating_1_18_1
        temperature: '{{ trigger.to_state.state | int }}'

this is the sensor entity that I created to display on the front end and simplify the second automation:

# Downstairs Heat Temp Setpoint
- platform: template
  sensors:
    hvac_downstairs_heat_setpoint:
      value_template: "{{ states.climate['2gig_technologies_ct101_thermostat_iris_heating_1_18_1'].attributes.temperature }}"
      friendly_name: "Downstairs Heat Setpoint"

And here is the automation that I use to update the input slider value:

- alias: downstairs hvac heat input slider
  hide_entity: True
  trigger:
    platform: state
# this is the sensor I created. It simply shows what temp the unit is currently set to
    entity_id: sensor.hvac_downstairs_heat_setpoint

  action:
    service: input_slider.select_value
    data_template:
      entity_id: input_slider.downstairs_heat
      value: "{{ states.sensor.hvac_downstairs_heat_setpoint.state | int }}"

These are working, as they are straight out of my config.

1 Like

Uggg. I had high hopes this would work for me but alas, no dice. Thanks for taking the time to post though. I donā€™t know what is missing but I can set the temp from the slider all day long, but cannot get the slider to update with changes at the thermostat itself.

Did you get the sensor created for the thermostat setpoint? If you did, then just be sure you can get
"{{ states.sensor.thermostat_setpoint.state }}" to return the numeric value of the thermostat setting in the home assistant template testing area.

ā€¦mine displays as a float, i.e. 69.5, so that is why I added the | int to the end of the statement.
ā€¦it should work. If not, then post some of your work into the gitter chat room and we will help you get it!

Excuse the interjection, but where is the HA template testing area?

Developer tools in hass - left side bottom row, second-to-last icon, looks like <>

1 Like

I got the sensor made, it was just called sensor.hvac_setpoint but I am not returning any values from it. As a result, I kept getting errors about sensor value being none or something like that.

I will try and get on gitter soon and see if we can come up with anything there. Thank you for offering that as well.