I apologise in advance if this seems trivial. I have spent several days trying to solve this problem, and I have read various Home Assistant help documents. I have only been using Home Assistant for a week or so, and I have no programming experience.
What I am looking to do is to switch on relays which have a web server built in. I can do this easily by typing into the address bar of Google Chrome eg
if I type xxxx://192.168.1.4/30000/01 it will switch relay1 on
if I type xxxx://192.168.1.4/30000/00 it will switch relay1 off.
(hopefully you can guess what xxxx is - the forum didn’t like me typing it there as I’m a new member)
I have tried writing command line instructions (based on Home Assistant documentation examples), I have tried using telnet similarly - both in the configuration YAML, and I also tried to get a template working. All unsuccessful.
I think I need to put something like this into the configuration YAML:
switch:
- platform: command_line
switches:
RELAYRELAY:
friendly_name: ‘Relay switch on’
command_on: ‘curl -k “http://192.168.1.4/30000/01”’
command_off: ‘curl -k “http://192.168.1.4/30000/00”’
but a) I can’t find the switch anywhere to add to the Home Assistant display and b) I don’t think it works. I wondered whether I should be using a template or using a shell commmand, but most of this stuff is beyond my knowledge at the moment. Would be great to be able to get something to work then I could experiment and improve it, but I’m not even off first base!