The final part is to glue things together in an automation. In configuration.yaml i added:
Now calling myself will flash the lighs in my living room 🙂
When things go wrong.
I wanted to see what happened if my Asterisk server wasn’t running. It seemed pretty bad for my Home Assistant 🙁 It took almost 5 minutes to start up!
So I did a little investigation and found out the the pyst2-library wasn’t handling this situation very well. I did a small modification to /srv/homeassistant/lib/python3.5/site-packages/asterisk/manager.py in the connect() method:
I added a timeout for the socket connect and then set it back to normal after the connection was made. This seemed to solve my problem.
End of project.
I hope you found my little writeup useful. Post a note if you like it or not 🙂