Call a blueprint from another blueprint

Hello

I am developing a blueprint to control the occupancy of a room using a motion sensor and a door sensor. It is currently adapted to my lighting tastes with different color temperatures depending on the sun.

I would like to make this blueprint useful for more people so I have tried to parameterize it, but it seems to me that it is starting to get complicated. Too many options.

I find the blueprints functionality great, very useful for sharing automations, but I think it could be improved.

I have seen that in the repository there are quite a few variations of the same functionality, such as the aqara magic cube for different integrations and with different variations of the functionality.

I myself have taken the code from other blueprints, like the one for the Ikea 5-button switch from frenck, to adapt it to my way of managing lighting.

I have thought about approaching my blueprint in an open way without being tied to the light management that I like and using a script to contain that light management logic. In other words, apply the principle of single responsibility for software development. A blueprint for managing room occupancy and a script for managing lighting.

Although it is possible to do it, the graphical part of the script call is lost, making it less user-friendly.

My feature request is that another blueprint can be called from one blueprint. This way when someone wants to use my blueprint in the action to be taken when the room is occupied, they can choose another blueprint instead of an action or a script. Or some mechanism to have a way to easily share scripts and have a graphical interface when they are used

Another use case would be to call a light management blueprint at the push of a button on the ikea 5 button switch or in the aqara magic cube.

My blueprint is not finished yet but you can see it here https://github.com/inigoserrano/homeassistant/blob/9ce4aa6dd6eaf95027669e47c643f8fae8a08f2b/banio/blueprint.yaml

Many thanks to everyone who makes this incredible tool possible.

You wouldn’t be calling another blueprint, you’d be calling another automation that was generated by another blueprint, which is already possible.

Just add

service: automation.trigger 
entity_id: !input your_automation

And the end user of you blueprint can add the automation they want to trigger (whether it was generated by another blueprint or not).

I use template binary sensors to determine the occupancy of my rooms based on motion, tv/pc running and BLE presence detection sensors. Maybe your automation can also replaced with binary sensors. Can you share the autonation to determine room occupancy?

1 Like

Sure here is the code.

It is based in a finite state machine

I am going to try the binary sensor as you propose. Thanks

I have update the documentation, it is not fully completed.