Pushing mutesync status instead of using the local polling integration

I wrote an AutoHotKey script to push the status of the mutesync button to Home Assistant rather than using the built-in integration which uses local polling. I did this because local polling doesn’t work when my computer is connected to my company’s VPN. Unfortunately, the script works great on my personal computer but I ran into TLS/SSL issues on my company computer that prevents me from sending POST data to my https home assistant endpoint (even when NOT on VPN). So until I resolve that, this is worthless for me.

Hopefully someone else can find some value from it:

This is my first attempt at an AHK script, and also my first attempt using the HA REST API, and also my first attempt trying to grab data from mutesync. So the code is dirty and suggestions are welcome.

2 Likes

Hi @mekaneck,

Thank you for this script!
On my company laptop it works totally fine, even with vpn activated.
But I found two bugs in your script in line 82 and 83.
Here are my changes

	muteStatusLoc := Instr(responseText, """muted"":") + 8
	muteStatusRaw := SubStr(responseText, muteStatusLoc, 4)

I updated the script, thanks for the fixes! Glad you found it useful.

This is great! Really appreciate you posting this.