I have this blueprint I created which I require the user to provide the entity for each sensor.
But the Apollo Air Esphome gives you an “Apollo Air” device that has all the entities underneath it.
My question is, can I design the blueprint in such a way, that the user only needs to specify the “Apollo Air” device, and the entities will be automatically grabbed from the device?
I can think of 2 ways I’d want to implement that:
Set the default value of the entity input, for example, the “temperature sensor” default value will be grabbed from the provided device, with the option to change it if the user needs it.
There will be no need to specify an entity for each sensor, and the blueprint will only use the specified “Apollo Air” device. (But then what would happen if the user renamed one of the entities to a custom name?)
Did you figure this out? I’m trying to create a blueprint for MSR-1 where I turn on its rib light based on its reading for CO2 level and it seems weird to have to select entry of the light and then the co2 sensor in separate inputs vs just selecting the sensor (MSR-1) itself only once.
I don’t have the device in question, but it should be possible as long as you can insure that the sensor entities are determinable by either their entity ID or one of their attributes:
Thanks! With your example now I understand what the first answer was trying to convey. I still do not know much and trying to learn. I’ve spent over an hour trying to figure out how to use those new variables in the next step and reference the entity_id for the co2_sensor:
Thanks again! I’m clearly in over my head here. Not sure how to learn all these things without having to ask someone
I implemented your suggestion and then some more, but I made basically some guessing on how to reference the light variable and wanted to try to see if it works or I get some useful error that I can try to figure out but… did not get very far.
I got this error when trying to create the first automation:
I did try to search through the community and docs on how to retrieve the entity_id from it but could not find anything that worked, but I did not find a direct example that uses a variable. I’ve tried diff variations on formatting this but nothing worked so far.
This is the full blueprint:
I tried your suggestion but now getting error: Message malformed: Unknown entity '{{ light }}'
I also took your other suggestion and tried to google programming/crawl and all I get is what is and how to make web crawlers. Maybe you have a link to somewhere that is more specific on what you meant there.
Guess I didn’t look close enough at your code. You are using proper light.turn_on actions for turning the light on, but those awful device actions for turning the light off. Never use device actions, their code is barely readable and they do not support templates, hence why you are getting the error. Replace the device actions with proper light.turn_off actions and it should work.
In addition to the change Magnus mentioned, there are a couple other changes that you might want to consider.
Get rid of the Device actions you have for turning the light off. Just use a basic entity-based action. They are less complicated to write and easier to read:
As it is currently configured, the light will go from off through your color/brightness combinations stopping at red. It will stay red until the sensor’s value drops below 1500. If that’s what you want, great… otherwise you will need to alter your triggers.
@Mayhem_SWE && @Didgeridrew Thank you both!! I finally was able to create a new automation using this blueprint without error. Learned a lot from your advice! I had those Device actions the way they were created from the automation I made using UI and I copy/pasted that to this blueprint as a base. Wasn’t aware that there was a difference, good to know. @Didgeridrew thanks for pointing out the 2nd point you mentioned, I’ll need to tweak those triggers. My first goal was to just get it working… now I just have to wait till my office gets stuffy to see if the light goes off