It’s possible to controle switches connected to this hub using curl. The following two commands switches a Home Easy Plug-in switch:
(elro.eu/en/products/cat/home … -in-switch)
Is there a project for this component?
If so, which one and how can i help?
If not, what would be the best course of action to integrate this hub into HA. Is there a component which i could use as a starting point?
There is support for RESTful devices…could be a way to integrate your gateway but it’s seems that the payload is pretty extensive. I guess that the quickest way would be to use a Command line switch.
@jarod83 How did you come by these headers & url’s??
I have the same sender and i would like to get some python scripting going to be able to switch without that hideous webpage and integrate it into my home automation system…
@jarod83 well thank you for initially proving it could be done!
I got some time today and managed to write some bash script with which I now can control the switches! (Using somatic so sorry for that…)
If you are interested i could post this tomorrow ( on my phone now…)
Sure, but be aware, i am in no way a programmer so the code could be incomplete (i know the dimmercode has some issues…)
For the switches you could use:
#To use give command lightswitch.sh 2972 off where 2972 is the devid for the switch!
switch=$1
type=$2
IP=$(curl -X POST -d “UserName=XXXXXXX&UserPassword=XXXXXXX” -v -L 192.168.178.106/cgi-bin/uservalid.cgi)
description=echo $IP | sed -e 's/^.*"session"[ ]*:[ ]*"//' -e 's/".*//'
curl -X POST -d “optype=singledev&devtype=switch&controltype=”$type"&devid="$switch"&sessid="$description" -v -L 192.168.178.106/cgi-bin/devicecontrol.cgi
Next for the dimmer:
#controls connected dimmer command would be ‘script.sh 10%’
action=$1 #could be ‘on’ /‘off’ / ‘40%’
if [[ $action == “%” ]] #The dimmer goes in steps of 10%, so get the first and add a ‘0’ when we dimm it…
then
action=${action::1}0;
fi
IP=$(curl -X POST -d “UserName=XXXXXXXX&UserPassword=XXXXXXXX” -v -L 192.168.178.106/cgi-bin/uservalid.cgi)
description=echo $IP | sed -e 's/^.*"session"[ ]*:[ ]*"//' -e 's/".*//'
curl -X POST -d “optype=singledev&devtype=dimmer&controltype=”$action"&devid=2194&sessid="$description" -v -L 192.168.178.106/cgi-bin/devicecontrol.cgi
now i realise since this is my first time tinkering with HA, this probably not the cleanest way to get this going, but ey it works, i can even call it trough my google home
/edit, now i need to learn how to format on this forum
/edit2 simplified the method
creating lightswitch.ch works, and in automations.yaml adding
platform: command_line
switches:
light_yournamehere:
command_on: sh ./lightswitch.sh your firefox f12 3-4 digit code here on
command_off: sh ./lightswitch.sh your firefox f12 3-4 digit code here off
friendly_name: name you want hassio to show here
command_timeout: 3 (timeout time in seconds here)
the whole text, per switch
and indeed it makes an off and on symbol at next full restart for each switch and succeeds to send the commands to the elro smartwares box
thanks !