First post. Set up HA a couple of weeks ago and very impressed. May have overestimated my technical competence but have managed to figure out everything I needed to. Until today.
I haven’t tested version 0.101.X yet but maybe one clue to this issue is that it reports sensor.template yet this is a Template Light not a Template Sensor.
Invalid config for [sensor.template]: [lights] is an invalid option for [sensor.template]. Check: sensor.template->lights
@Lyshco share the “light” part of your configuration.yaml exactly as it is and include 10 lines or so above and below the light: section. If you have your configuration broken into multiple files, share each of the pieces that lead up to lights and include 10 lines above and below each of those too, just in case. If there isn’t an issue there, then this appears to be a bug in Home Assistant and I recommend opening an issue.
Here’s the embiggened portion of the configuration.yaml. I originally dropped the code in after the bus / train sensor section (which I haven’t included all of) which prompted the error message. So I moved it above thinking maybe it was inheriting the sensor piece, but get same error message. It’s exciting to think I might have discovered an actual bug but given how new to all this I am I was very much assuming the fault was likely to be mine.
That’s what I was wondering about @123 - whether there might have been a change to how to instigate a template light. As a total noob it’s reassuring that I’m not completely off piste. Thanks
Indeed. This is an exact copy of the example configuration from the docs, I suspect the OP doesn’t actually have any ‘theatre lights’ and we’re on to a big XY problem.
@Lyshco - please tell us what you are trying to achieve with your template light?
FWIW, I entered that example, verbatim, into my lights.yaml file and in version 0.99 the error message is different. It carps about being unable to update light.theater_lights which is understandable because none of its sensors exist in the configuration.
Hopefully not an XY problem but you’re right, I don’t have any theatre lights. I did originally localise some of the details but when it didn’t work I went back to first principles to see if I could get the verbatim code to work.
My understanding of a template light - and what I’m trying to achieve - is that rather than exposing everything to Alexa and building whole stack of Alexa routines, I can set up a template light - a device that doesn’t physically exist but can be passed values by Alexa. I can the use these values as triggers for eg firing a script.
To do this, it’s far easier to make an input_boolean and expose that to Alexa as a switch. I have several of these set up. So Alexa turns on the input_boolean, then as part of the automation/script, I turn it back off so it’s ready for the next time.
Large numbers of Input_Boolean switches can be confusing and fill the alexa app . One virtual light switch can represent 99 input_boolean switches . I only use input_boolean switches that alexa can switch on and off directly without additional HA coding. Anything else I use one virtual light bulb, makes coding simpler and keeps the aleax app lean.
Thanks everyone for your help with this. Having gone through it all again, put it higher up in the configuration.yaml, picked through the indentations and adding the missing “-”, I now have a working template light - and it’s not even called “Theatre Lights” anymore.
I’ve also learned about input_booleans which aren’t quite what I wanted in this instance for the reasons @lonebaggie highlighted. But now I know they exist I may well use them in other situations.
So muchos gracias for help with my first HA stumble. Good app, good community. I think I’ve made a good choice. Cheers
I guess I don’t see the difference. I can just as easily make one input_boolean and have it switch 99 light bulbs as I can make a virtual switch and have it switch 99 lights, no?
In both cases, you are making a “virtual” entity in HA that represents any number of “real” things. In one case it’s done by coding a template switch, in the other via an input_boolean. To Alexa, it’s all the same.
An Input_Boolean has two states off or On . A Virtual Bulb dimmer has 100 states 0 to 99
So I can set routines in the Alexa App to set one virtual bulb to any state 0 to 99 and then only have to deal with one switch in HA . Also I use the alexa App to control all my devices when I am off site. Multiple Input Boolean switches “fill the interface” so unless they directly control a “thing” in my house and can be named as such ie TV I use one virtual bulb to replace all the other input Boolean. If you only have a couple of Input Boolean switches , not an issue.