Skip to content

Instantly share code, notes, and snippets.

@niecore
Created July 16, 2021 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niecore/fe81f7b7660d3f44c21a0bcd7eb3fab8 to your computer and use it in GitHub Desktop.
Save niecore/fe81f7b7660d3f44c21a0bcd7eb3fab8 to your computer and use it in GitHub Desktop.
homeassistant command line switch with usbrelay
switch:
- platform: command_line
switches:
switch_name:
command_on: "usbrelay RELAY_1=1"
command_off: "usbrelay RELAY_1=0"
command_state: "usbrelay | grep -i 'RELAY_1' | grep -E -i '=1'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment