Finally I was able to connect my self buildt door Computer (hosting a nfc/pin Lock and several detectors and bell knobs) to HA. I send bell notifications through rest to A and HA requests a picture of the Pi Cam like this:
What I now would to add is that notifications only arrive, if we are in the home zone. Unfortunately I am confused how o add an other template to use code like this:
Use the choose action.
There you set up two choose actions.
One if both is home, and the action to both.
And a second if Nicole is home and that action, and in the default action you set notify Michi.
I’m not sure you can Jinja the service like that.
Its intended to produce nothing in that case as we both do not want to receive the bell notification if we are not at home. Should I create a kind of dummy service for that case? If the error does not flood log files I can live with it as long the rest works.
You are absolutely right! I will try solving it using choose. As I unfortunately have very little spare time to deal with the HA project I was happy to get it up and running in the first place. But I absolutely share the philosophy to do things right instead of doing it the hacky way!
There’s a Template Condition within the action that permits execution of the service call only if at least one device_tracker indicates home. If no one is home, the service call is not executed and the automation ends.