I’m working on a Blueprint and can’t seem to find the proper way to handle something. Some of the options won’t make any sense and the user should not have to fill them out. Let’s say they are picking between a bicycle and a car. It makes no sense for me to present them with the option “Moon roof”. If I can’t hide the options that is fine but at the least I need a way to set a default option so the automation doesn’t fail. Some of the error messages aren’t that helpful to me as a newbie to blueprints. I don’t see a way to add a default in the documentation. I believe there might be a way to fix this in the variables section but not quite sure how to do that.
Based on your feedback I thought perhaps I could use a boolean with an if then statement in the variable section. I thought if I didn’t actually try to grab the variable that was left blank HA would not care it was blank. I tried variants of the following logic but unfortunately HA still complained when moon_roof was left empty.
Oh well… For the foreseeable future I will have to make sure the end user fills out every selector. My blueprint should be completely function. I’m currently letting it run to see how it handles real data. Then I’ll open it up for others to play with.
The best way that I have found to learn how to do something in HA coding is first, read the docs and find out what you can and cannot do. This is not always clear but gives you some guidance. After that I go into the forums here and search out where someone else does it. The blueprint exchange, I’m certain, has an example of someone else doing something similar. Here is a link to where I use that select selector with defaults to pick a weekday (or multiple). Leaving out the list of defaults will default it as empty.
Thanks! I did indeed read the documentation but Select Selector did not mention defaults. I then started looking at other peoples code but could not find what I needed. Finally I posted here. I don’t know what the heck I did wrong because I even put it at that same indentation level when @SgtBatten suggested it yesterday. Whatever I did wrong yesterday it now works today.