Local control of Audioflow 3S-4Z device?

Given Audioflow devices support Alexa I'm sure there's a way to integrate them with Hubitat generally, but I'm wondering if anyone has figured out a local control method?

I forgot to mention there's an MQTT based Home Assistant integration that Audioflow willingly endorses on their website (someone else made it but cool to see the company allowing it): https://github.com/Tediore/audioflow2mqtt

Creator of audioflow2mqtt here! The audioflow speaker switch uses a local API which is documented here: flow.audio/Audioflow%20API.pdf

Tbh I should really create a Python library for it instead of just audioflow2mqtt.

1 Like

Awesome! Welcome to the HE community! I'll check out the API and start messing around when my unit arrives... I think on Tuesday.

1 Like

I also just remembered the documentation is slightly off from the actual API in one section. I'll double check in the next few days and report back

1 Like

Okay yeah, I found the issue I was referring to with the API. At /zones you can find the state of all zones with IDs from 0-3 (the max value depending on which switch you have, of course). The API documentation says the state of a specific zone can be found at /zones/x where x is a value from 1-4. While that's already strange enough since the zones start at 0 at /zones, what's even stranger is that /zones/1 returns the value for zone 2, /zones/2 returns the value for zone 3, and so on. Oddly, /zones/4 returns the value for a zone with an ID of 5 which doesn't exist and, on my end at least, appears to always be on. /zones/0 doesn't exist, so you can't get the state of the first zone only.

It's not really a big deal since you can just reference the /zones endpoint and get whatever zone state you want (which is exactly what I did), but I figured I'd share since it's a weird issue. I did let the company know about the API issue, but I unfortunately haven't heard back.

lol... that's a confusing one for sure. Sounds like the AudioFlow folks went full ham on OB1 errors

Haha indeed they did, but at least the endpoint that shows all zones at once is correct :sweat_smile:

Do you happen to be aware of any Hubitat drivers for similar TCP-socket controllable devices? I'm looking for something I could adapt to work for this purpose, rather than trying to write a driver literally from scratch.