
But with a little effort I wrote a LUA code that enable the automatic support of this relays board (and it's working very well inside domoticz


http://www.robot-electronics.co.uk/htm/eth8020tech.htm
This is a pretty cheap relay board with a ethernet interface.
Interfacing with domoticz is pretty easy.
Follow the installation guide:
-- INSTALL GUIDE:
-- 1) Create 20 new virtual Switches into domoticz using "Dummy Hardware" and selecting type "Switch"
-- to automate the creation process, you can use the domoticz JSON API and the following bash for loop:
-- for i in $(seq 1 20); do curl -s "http://localhost:8080/json.htm?type=cre ... pe=6&idx=2" ; done
-- NB. change idx according to "Dummy Hardware" used ID, in my example Dummy Hardware into domoticz.db matches IDX 2
-- 2) From Devices TAB, add/activate the new Switches into Domoticz and give they a name as you like
-- 3) Save the attached lua script into $DOMOTICZ_HOME/scripts/lua/script_device_eth8020.lua
-- 4) Edit the script_device_eth8020.lua changing only the name of every relay listed in the variable array (default are: "Relay 1", "Relay 2" ... etc)
-- TODO: parse the eth8020['Status'] xml file and update domoticz relays status when activated outside domoticz (like from an inwall push button)
-- TODO: Write a domoticz native driver to avoid this lua script and manage all relay buttons directly from domoticz hardware tab
Now I need help from a more skilled LUA developer to get and parse the http://eth8020/status.xml file generated from the board when the relay are activated externally.
the file is pretty simple, it generate this output:
Code: Select all
<response>
<relay1>1</relay1>
<relay2>0</relay2>
<relay3>0</relay3>
<relay4>0</relay4>
<relay5>0</relay5>
<relay6>0</relay6>
<relay7>0</relay7>
<relay8>1</relay8>
<relay9>0</relay9>
<relay10>0</relay10>
<relay11>0</relay11>
<relay12>0</relay12>
<relay13>0</relay13>
<relay14>0</relay14>
<relay15>0</relay15>
<relay16>0</relay16>
<relay17>0</relay17>
<relay18>0</relay18>
<relay19>0</relay19>
<relay20>0</relay20>
<adc1>1023</adc1>
<adc2>1023</adc2>
<adc3>1023</adc3>
<adc4>1023</adc4>
<adc5>1023</adc5>
<adc6>1023</adc6>
<adc7>1023</adc7>
<adc8>1023</adc8>
<volts>15</volts>
</response>
1= on
any help is very welcome

when finished will follow another guide to build an arduino board that connected to in wall switches will activate directly via ethernet every relay of eth8020 board (and I need to update domoticz relay status according of status.xml output).
Kind Regards