Switch state based on ADC sensor voltage output - Shelly UNI

Hi,

I’m pretty sure that this is a frequent scenario, however my search didn’t came out with any solution to my problem.

I’m using a Shelly UNI to automate a dumb in-wall ceiling speaker control to power on and off the speaker. I have connected the relay to the button control so I can power on and off the device, however I needed to know if the speaker is powered on remotely, so connected the ADC sensor to one speaker output.

Right now, I use the Shelly UNI Relay to ‘click’ the button, so need to power ON and OFF the relay to get the device to change state, and I monitor the ADC voltage to know if it’s ON or OFF.

What I want to accomplish - Connect somehow the ADC voltage to the entity state so when I click a lovelace button for the speakers, it triggers the ON then OFF on the Shelly UNI relay and the entity state is ON or OFF depending if the ADC records any voltage or not.

I’m using Home Assistant 2022.7.6, on OS 8.2 on a virtualmachine Win10.

Thanks