How can I trigger a Python script on a remote RPi with HASS.IO?

And one more finding regarding the autostart of this script: For some reason none of various autostart options worked. The solution is simple: insert a waiting period before the script is autostarted.

I ended up using good old crontab -e with this line

@reboot sleep 60 && python3 /home/pi/MyScript.py

and then it worked!

Awesome! Well done @sapnho and have a good week-end.

Thanks Christophe! The next step is now to get the state information from the picture frame back to Home Assistantā€¦

This all works beautifully now using MQTT to pass data between devices. Thanks for your support!

I have written up my learnings from this thread for those who may be interested: https://www.thedigitalpictureframe.com/control-your-digital-picture-frame-with-home-assistents-wifi-presence-detection-and-mqtt/

Thanks again to everyone having helped on this one!

5 Likes