I have added ADB to a docker container named “ADB”, and with the new SSH/Terminal and protection mode “off” i am able to run the command:
“docker exec -it ADB adb shell input keyevent KEYCODE_WAKEUP”
And the outcome is exactly what i want.
But now to my problem.
How do i put this line of command into a script that i can call from Hass.io?
Or is there any other way (not script) that i can use?
I want to tie this command to a button in lovelace.
Use a command_line
switch for example:
I have tried that, bur i get this error.
switch:
- platform: command_line
switches:
shield_wake:
command_on: "docker exec -it ADB adb shell input keyevent KEYCODE_WAKEUP"
Error:
2018-11-26 17:46:38 INFO (SyncWorker_12) [homeassistant.components.switch.command_line] Running command: docker exec -it ADB adb shell input keyevent KEYCODE_WAKEUP
/bin/sh: docker: not found
2018-11-26 17:46:38 ERROR (SyncWorker_12) [homeassistant.components.switch.command_line] Command failed: docker exec -it ADB adb shell input keyevent KEYCODE_WAKEUP
Maybe i have made somethig wrong?
Could it be a permisions error?
When im logged in with ssh im logged in as root, maybe when hass.io is suppose to run the command it is not allowed?
Did you find a solution here?
I have similar problem. I’d like to start/stop a docker container with a command_line switch, but didn’t figure it out yet.
Look at HA-DOCKERMON
Thanks, this is the next step.
Tried it with Portainer and REST switch, but couldn’t make it work.