How to send adb command to TV?

Hello everyone,
I would like to send a simple adb command whenever a sensor reaches a certain state.

The command is just a simple
svc wifi disable

I saw that adb shell is depricated and python is now being used to control TVs. But is this the way to go to send this really simple command? I don’t want/need any other feature except sending that specific command to a device via adb.

if you download and install adb in your operating system and if it is accessible from shell, you can run this command;

adb shell su -c 'svc wifi enable' or disable

Assuming you need to send this command over network, you can use this;

adb -s 192.168.56.101:5555 shell su -c 'svc wifi enable'

1 Like

Yes, adb shell is installed and working on the host.

So I would then use shell command in an automation?
Is there a more direct way without creating the shell integration and defining the command in a config file? Like simply parsing the command directly?

not as far as i know, let’s see what others say. And you are right about shell command.

When you say adb shell is deprecated, do you mean this one? Home Assistant Community Add-on: ADB - Android Debug Bridge

I would still use it :slight_smile: