Hi everyone,
enjoying the power of HA for a couple of weeks, I’m struggling with something for the past couple of days.
I’m trying to create a script that iterates over a list and call a shell command over them. Basically, in bash it would be
for i in foo bar baz qux; do
some_command $i
done
My current implementation looks like this (the service call doesn’t complain, but it does nothing):
service: shell_command.integration
data:
id: >
{%- set mylist = '20a45378cfe4c36c89ad16e056da59b1
e5633f2cf5aea5403e54b6d87a96e843 8cb9b789e7d1a4332f7e0c7381965d13
f007dc7017cb69eeab71a93bc740d79c' -%} {{mylist.split(" ")}}
state: disable
For those who are wondering, I’ve made a python script to activate/deactivate integrations without having to use the webUI. It allows me to turn on the camera plugs (yi-hack) and to activate the integration without having to let the cameras on and without my logs being filled with warnings if they are off
This python3 script is called from a shell_command
with an uuid and state as parameter.
Thank you for your answers!
P.S:
- I can provide the python script if someone is interested.
- If someone has a better solution, I’m all hear (but AFAIK, there’s no automation for activate/deactivate integrations)
EDIT: I’ve also created an input_select
with the 4 values but I’m definitely not sure how to use it