12-08-2021, 08:13 AM
here is a http url command integrate with home assistant config demo sample for button5 (thanks for our customer supplied the config code)
- platform: command_line
switches:
poolbtn5:
command_on: "curl -k --silent 'http://192.168.1.136/sw_ctl.cgi?Relay05=ON&postpwd=12345'"
command_off: "curl -k --silent 'http://192.168.1.136/sw_ctl.cgi?Relay05=OFF&postpwd=12345'"
command_state: curl -k --silent 'http://192.168.1.136/sw_ctl.cgi?RelayFF=RD&postpwd=12345' | grep -oP "(?<=btn5)(.*)(?=btn6)"
value_template: '{{"ON" in value}}'
friendly_name: poolbtn5
- platform: command_line
switches:
poolbtn5:
command_on: "curl -k --silent 'http://192.168.1.136/sw_ctl.cgi?Relay05=ON&postpwd=12345'"
command_off: "curl -k --silent 'http://192.168.1.136/sw_ctl.cgi?Relay05=OFF&postpwd=12345'"
command_state: curl -k --silent 'http://192.168.1.136/sw_ctl.cgi?RelayFF=RD&postpwd=12345' | grep -oP "(?<=btn5)(.*)(?=btn6)"
value_template: '{{"ON" in value}}'
friendly_name: poolbtn5