Added support for robot elettronics eth8020

Moderator: leecollings

Post Reply
jin
Posts: 62
Joined: Thursday 18 September 2014 20:28
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Added support for robot elettronics eth8020

Post by jin »

I state that I am not a developer, and especially not a LUA developer :)

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 ;)):

Image

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>
0 = off
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
Attachments
script_device_eth8020.lua.gz
(1.49 KiB) Downloaded 229 times
ivom74
Posts: 52
Joined: Wednesday 03 September 2014 22:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Added support for robot elettronics eth8020

Post by ivom74 »

anyone experience with it? how fast works input changes into domoticz? fast enough for a doorbell :-)?
i saw the device is in the device list off domoticz.
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Added support for robot elettronics eth8020

Post by StanHD »

Hi, I use the ETH008 (Similar to ETH8020, but only 8 relays). I started using this before the hardware add-on was included in Domoticz like this:-

Image

Very simple and reaction time appears to be instant. I still use this method as it works so well, however, I guess the Domoticz hardware should do the same. ;)
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
jurgen
Posts: 30
Joined: Friday 02 October 2015 19:09
Target OS: NAS (Synology & others)
Domoticz version: stable
Contact:

Re: Added support for robot elettronics eth8020

Post by jurgen »

Hi all,

Is the ETH008 relay bord full compatible with domoticz? Can i add the hardware for 8020 and switch the eth008 modules or do i need to manually configure the http actions?

thank you!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest