TCP Switch

I would like to be able to add a TCP based switch where the on/off is not something in the payload but rather an extension of the URL. So something similar to a RESTful switch but a little different like:
switch:

  - platform: tcp
    resource: http://192.168.1.50
    url_on: '/on'
    url_off: '/off'

so an on request would call 192.168.1.50/on and an off request would be 192.168.1.50/off

I am migrating away from a homewizard setup (433 Mhz). While I am replacing all the switches with Z-Wave or Zigbee, I would like to be able to use the homewizard API while I’m migrating my switches. It uses the format of http://ip/password/sw/9/on for example (I know, password in the url…)

Is there something that exists that I can use?

You are trying to call the Homewizard API through Home Assistant?

It looks like the HomeWizard API is HTTP based, so you wouldn’t want just bare bones TCP. Look at the command line switch, and using curl:

Thank you! This works like a charm and wow, quite powerful that command line switch.

I noticed that there is an option of determining the state of the switch. In the case of Homewizard you can ask for the status of switches but it lists all switches, not just one. So I can ask for a /get-status in the command_state but how do I say something along the lines of:
value_template: {{ value matches “switches”{“id”:0,“type”:“switch”,“status”:“on”}* }}

You could do something like:

command_state: 'curl --silent HOMEWIZARDURL/getstatus | sed -e "s/.*switches.*id..0.*status...\(.*\)\".*/\1/"'
value_template: '{{ value == "on" }}'