I need some guidance, at least on what to search for. I have this wireless reed switch working well in HA. This card shows its status.
Below is the config. How do I have the state change of the reed switch fire a bash script on my raspberry pi ? Is it a tap_action and call service or an automation ? The script will just do a wget of a URL, do I use url instead of call service ? I find the docs to be comprehensive on the site, I just have trouble piecing it all together.
Thanks
It’s just an automation that you do not put in the Lovelace front end config.
trigger:
platform: state
entity_id: binary_sensor.wyzesense_6767672
to: 'on' # or 'off' or both if you leave this line out
action:
service: shell_command.whatever_you_call_it
I know one thing, shell_command has some super secret hidden syntax.
touch /tmp/foobar [doesn’t work]
touch foobar [works, writes to HAhome]
bash touch.sh [doesn’t work with touch.sh in HAhome or anywhere]
touch.sh [doesn’t work with touch.sh in HAhome or /usr/bin]
/usr/bin/touch.sh [doesn’t work]
using single quotes, double quotes, no quotes [doesn’t work]
so curl works, therefore I created automation.py in the cgi directory of my local lighttpd webserver and am using it to fork what I really need to run. It is a jiveazz way to do it, but I need to move on.
HA has some simple aspects and some infuriating logic defying aspects. Sadly I spends hours and hours on the latter.