Working with a blueprint where I want some actions pre-selected.
I get error: Incorrect type. Expected “object” at the row “within_deadzone_actions:” but I can’t wrap my head around why
below_deadzone_actions:
name: Low prices and temperature BELOW thermostat deadzone
description: Actions to perform.
default: []
selector:
action:
- service: climate.set_temperature
target:
entity_id: !input climate.entity
data_template:
temperature: "{{ states('input_number.heating_deadzone') | float + states('input_number.thermostat_entity') | float }}"
- service: climate.set_hvac_mode
target:
entity_id: !input climate.entity
data:
hvac_mode: 'heat' # Replace with the appropriate HVAC mode
- service: climate.set_fan_mode
target:
entity_id: !input climate.entity
data:
fan_mode: 'low' # Replace with the appropriate fan mode
within_deadzone_actions:
name: Low prices and temperature WITHIN thermostat deadzone
description: Actions to perform.
default: []
selector:
action: {}
above_deadzone_actions:
name: Low prices and temperature ABOVE thermostat deadzone
description: Actions to perform.
default: []
selector:
action: {}
Is that an input? If so it cannot use an input in it’s definition. Also that list needs to be delimited, or HA interprets it as yaml. If you want to have a default, that is not the syntax, nothing after action: is allowed. Lots of formatting problems. Perhaps look at other examples in the exchange for inspiration.
It’s very hard to put code snipits like this into context. I don’t like guessing on answers like that. Also why the extra spaces?
I’ve probably looked at some poor examples and drifted off from reality at that point ◑﹏◐
The goal was to create a “pre-set” actions setting to make the setup and use of the blueprint easier - not having to manually choose call service, entity etc.
I played around with this because curious. Apparently the code segment you plug in does have to render. and as I suspected !inputs cannot go in the default because they will not render. So you can do this…
Then you have most of your code that you can edit when you set up the automation that you will run. change the climate entity and delete the ones you don’t want.
Basically just like you figured out how to do for the rest of the defaults in your code.
Defaults go into defaults: key section, not random places in your code.
Every BP I do has it’s own helper file in Markdown and a long (short version) of that in the description. It fends off a lot of stupid questions. I just make sure everything they need to know and samples of what they need to add for this or that are there. I even wrote some script blueprints that they can use to build scripts because people were having trouble telling a script and an automation apart.
After that, whe I still get a ‘stupid’ question I thought was obvious, I edit things based on that question to prevent the question again, and look left-right to make sure my other BP’s won’t have that question.
Basically I don’t want to have questions that need answer. Less stress. Answering the same one over and over is definitely not an activity on my good list.
If you think I have helped solve your problem in one of my posts, would you be so kind as to click solution?