I have this switch, but it is staying only off, any idea?
- switch:
name: ADB Home Tablet
unique_id: adb_home_tablet
command_state: "adb devices"
value_template: "{{ '192.168.0.113' in value }}"
command_on: "adb connect 192.168.0.113"
command_off: "adb disconnect 192.168.0.113"
Thanks!
Edit: I added a shell_command as well, to see if is working and I get this error /bin/sh: adb: not found, why it is not working? In the terminal, all the adb commands are ok
Edit: i made the shell_command like this adb_home_tablet: "/usr/bin/adb disconnect 192.168.0.113"
but I still get not found… stderr: "/bin/sh: /usr/bin/adb: not found"
Home Assistant is running inside a docker container. The terminal is running on the host os. So if you want ADB installed in the container, you’ll need to shell into the container from the terminal using a docker exec -it
Ah… damn There is no solution to keep what I installed?
EDIT: I hope is working, I made another swtich
- switch:
name: ADB Tools State
unique_id: adb_tools_state
command_state: which adb
value_template: "{{ 'adb' in value }}"
command_on: apk add android-tools
command_off: apk del android-tools
Then I will do an automation, if is not installed, it will be after