I’m newish to HA, though I know a little. I’m trying to automate my ducted heating system. One thing I’d like to do is be able to switch the mode of one of the dampers from ITC to Damper. This will let me switch from temperature control to percentage control of the dampers to override the system which I need to do occasionally. Right now I switch back to the native app, but I’d like to stop doing that.
Ideally I would like to toggle between the ITC and Damper modes with a fairly compact control so it’s easy on my phone dashboard, and have a visual representation of which mode it is currently in. I can’t work out how to add something on the dashboard to do this. I’m mostly using Mushroom Cards.
i dont have a climate entity, but there is a service “Climate: Set preset mode” you should be able to set up a button on the dashboard to set the mode (untested guess below)
That’s interesting, thanks @chris.huitema . Ideally I’d like a single button of switch that toggle between ITC and Damper modes.
I added this to my dashboard, doing my best to follow your guide. I understand at a high level what it’s saying around dictionary and values, but it would take me a bit of time to fully understand it and work out how to resolve it.
You could use an input select helper and set the two states in the helper. Then make an automation that calls the service to change them based on the input select.
Not in front of a computer right now but happy to provide an example later if needed.
Create an “Input Select” Helper, name it “climate_itc_living_preset”, add the states “ITC” and “Damper”.
create an automation, have the trigger set to the “state” of the input selector “climate_itc_living_preset” created above. don’t set the to or from fields. leave the conditions blank
under actions call the service climate.set_preset_mode, select the target, and under the preset mode type
note: it will change that action to yaml as the GUI doest do templates.
Now you can add an “entities card” to your dashboard that will give you a nice dropdown box. whenever it changes it will call the service.
you could also have an automation so that when the state attribute of the climate.itc_living preset_mode changes it changes the input helper. you should be able to figure this out with the GUI options
Ah, I understand. I’ve gotten the dropdown showing the values I need, I’ve called it "input_select.livingdampermodeselect". It’s not quite working yet though.
Here’s the error message. Again I understand what it’s saying, but don’t know how to resolve it. Any tips?
Living Damper Mode Change: Error executing script. Invalid data for call_service at pos 1: value should be a string for dictionary value @ data['preset_mode']
Because I have four zones I would like to make it more compact. Based on what I’ve learned here I suspect I can use a button to do something similar, and change the button icon / color / something else to trigger the action.
if i put the {{ states(‘input_select.livingdampermodeselect’) }} into dev tools - tempate i get the string i expect to see… but for some reason the automation isn’t accepting it…
I can see the value changing in developer tools but the syntax in my action is incorrect. I don’t know enough about HA yet to fully understand, but I might work it out tomorrow. If someone else can spot it please let me know
After the automation is saved and I go back into it the preset_mode changes to preset_mode: null
Here’s the error when the first one is executed. Looks like it’s passing the whole dictionary of values in rather than just the desired state. When I hard code a state ITC / Damper in it works.
Error executing script. Invalid data for call_service at pos 1: value should be a string for dictionary value @ data['preset_mode']
Hard coding the value works, but doesn’t use the value in the dropdown. It’s the looking that seems to be failing.
how are you triggering the automation? from the button where you edit the automation or by changing the input select? or are you running it from a script? there needs to be the input select changing to trigger the automation so there is a value to set.
i set up a test case on my system using a light and setting an effect, it seems to work perfectly to set a value in the same way
perhaps try manually editing the automation in file editor to change the preset mode to the ’ {{ trigger.to_state.state }} ’ with the correct quotes.
Thanks Chris. I have a dropdown with the values Damper and ITC, both of which work when I hard code them into the action. I’ve tried that format and had no luck. I wonder if it’s something about the entity / service I’m using, the fan.turnon service. I use that service hard coded in a few places with no issues.
I’ll have a play with a button version when I get time. It’s a bit odd. It’s probably something subtle I’m doing wrong, as I’m not super experienced with HA.
I usually call the service “Fan Turn On” with a damper mode to change the mode, but for some reason that isn’t working with the dropdown. Calling climate.set_preset_mode (which you mentioned earlier) with the same parameter works fine. Definitely user error! Thanks for all your help @chris.huitema
If I get a button working I’ll post the code for that as well.
Im a little confused with your setup, i dont understand where the fan.turn_on service comes from? in your original post there is a climate.itc_living entitiy to target the service at?
Can you try adding a new automation, change to edit in YAML mode and paste this in - as is, and save.
alias: change_itc_mode
description: 'automation to change mode'
trigger:
- platform: state
entity_id:
- input_select.livingdampermodeselect
condition: []
action:
- service: climate.set_preset_mode
data:
preset_mode: '{{ trigger.to_state.state }}'
target:
entity_id: climate.itc_living
mode: single
it should target the entity in your original post and be triggered when you change the dropdown.
once you change the dropdown if you could have a look at the trace from the automation, click the > should show a result like the screenshot below (but this is for my light…)
You’re absolutely right - I posted just a few minutes before your last reply. It seems to work in some actions, but not others, to change the damper mode. When I changed to your suggested entity / service it worked perfectly
Thanks very much @chris.huitema , appreciate all your help! I’ll try this when I have a bit of time. Looks like I need an input select on the same dashboard to make this work, right?
Incidentally, the fan entity is how the electric dampers for the air conditioner are represented in HA. Using the climate service seems more reliable for operations though.