Page 1 of 2

Add support for IPX800, a standalone relay webserver

Posted: Friday 23 May 2014 10:36
by Grouic
I wonder what is the best solution to add support for IPX800 V3 Domoticz.
http://gce-electronics.com/en/home/57-ipx800-v300.html
The IPX800 is a standalone relay webserver with a LAN interface, which includes 8-32 relay output, 8-32 digital inputs and 4-16 analog inputs.
Way to communicate with IPX are:
- M2M protocol
- Push from IPX (on timer or event)
- Xml stream status
- JSON protocol
I think we should define a new type of material with:
- IP address
- Number of digital extensions
- Number of analog extensions
And then set each item separately

Thanks

Re: Add support for IPX800, a standalone relay webserver

Posted: Tuesday 10 June 2014 11:44
by elringer
Hello
+1 for me, the IPX800 is a great card

Re: Add support for IPX800, a standalone relay webserver

Posted: Wednesday 25 June 2014 8:08
by Manu35500
+1 ça serai un plus ^^

Re: Add support for IPX800, a standalone relay webserver

Posted: Sunday 21 December 2014 12:29
by Chaussette
Bonjour,

Moi aussi je souhaite piloter un IPX800.
Protocoles M2M et IP.

Doc des protocoles (Semble simple) : http://www.gce-electronics.com/attachme ... achment=47

Avantage : IPX Autonome pour piloter des fonctions spécifiques (Volets, Portail, Eclairage extérieur...).
Possibilité de l'insérer dans un ensemble Domoticz sur raspberryPI.

Cordialement

Re: Add support for IPX800, a standalone relay webserver

Posted: Sunday 21 December 2014 13:20
by mbliek
This is an English forum. In English please.

Re: Add support for IPX800, a standalone relay webserver

Posted: Tuesday 10 May 2016 11:08
by Petiot35
Hello,
That would be a really nice new feature.
Are you going to add it for IPX800 v3 and v4 ?

Cheers

Re: Add support for IPX800, a standalone relay webserver

Posted: Tuesday 10 May 2016 17:02
by Number8
I don't think this would a priority for the dev team, more a nice to have. I've been using the IPX800 v3 for 2 or 3 years and I had no difficulties to integrate it within Domoticz. Very easy to drive the relays (just an http url in On/Off action), fairly easy to retrieve the analog outputs.
For instance, to drive relays 5 On and 6 Off

Code: Select all

http://user:password@IPAdress/preset.htm?set5=1&set6=0
To retrieve analog values (3 channels), a bash script is needed

Code: Select all

#!/bin/bash                                                                     

IPX800=192.168.21.232

LOGFILE="/mnt/usbkey/tmp/ipx800.log"

DOMOTICZSERVER=192.168.21.240
DOMOTICZPORT=8080

#Create virtual sensors in Domoticz and enter their IDX's here. For the sensor types
IDX_TEMP_1=206
IDX_TEMP_2=198
IDX_TEMP_3=197
IDX_TEMP_4=

if ping -c 1 $IPX800 > /dev/null ; then  # if host is online then
	#Retrieve temperatures from IPX800
	curl --silent http://$IPX800/status.xml > $LOGFILE

	TEMP_1=$(cat $LOGFILE | grep "<analog0>" | cut -d ">" -f 2 | cut -d "<" -f 1)
	TEMP_1=$(echo 'scale=1;'"$TEMP_1*0.323-50.1" | bc | awk '{printf("%.1f\n", $1)}')
	#echo $TEMP_1

	TEMP_2=$(cat $LOGFILE | grep "<analog1>" | cut -d ">" -f 2 | cut -d "<" -f 1)
	TEMP_2=$(echo 'scale=1;'"$TEMP_2*0.323-50.1" | bc | awk '{printf("%.1f\n", $1)}')
	#echo $TEMP_2

	TEMP_3=$(cat $LOGFILE | grep "<analog2>" | cut -d ">" -f 2 | cut -d "<" -f 1)
	TEMP_3=$(echo 'scale=1;'"$TEMP_3*0.323-50.1" | bc | awk '{printf("%.1f\n", $1)}')
	#echo $TEMP_3

	for i in 1 2 3
		do
			#report Temperature
			eval IDX='$'IDX_TEMP_$i
			eval TEMP='$'TEMP_$i
			curl --silent $DOMOTICZSERVER:$DOMOTICZPORT'/json.htm?type=command&param=udevice&idx='$IDX'&svalue='$TEMP > /dev/null
		done

else
	echo "IPX800 not responding to ping, is it connected to LAN?"
fi
This one is a bit more engaging.
Need to modify the crontab, need to install bc in order to perform math operations, need to write in log file that is setup on a ram disk that turns to be a USB key in order to avoid SD card wear.

Crontab (refresh value every 3 minutes)

Code: Select all

*/3 * * * * (/home/pi/domoticz/scripts/getTemp.sh)

Re: Add support for IPX800, a standalone relay webserver

Posted: Friday 03 February 2017 11:44
by manuloup
hello,

+1

It is true that it would be great to have native support and all devices added automatically. Some other products like Jeedom already do it.

Re: Add support for IPX800, a standalone relay webserver

Posted: Friday 03 February 2017 18:44
by Clemen
Number8 wrote:I don't think this would a priority for the dev team, more a nice to have. I've been using the IPX800 v3 for 2 or 3 years and I had no difficulties to integrate it within Domoticz. Very easy to drive the relays (just an http url in On/Off action), fairly easy to retrieve the analog outputs.
For instance, to drive relays 5 On and 6 Off

Code: Select all

http://user:password@IPAdress/preset.htm?set5=1&set6=0
To retrieve analog values (3 channels), a bash script is needed

Code: Select all

#!/bin/bash                                                                     

IPX800=192.168.21.232

LOGFILE="/mnt/usbkey/tmp/ipx800.log"

DOMOTICZSERVER=192.168.21.240
DOMOTICZPORT=8080

#Create virtual sensors in Domoticz and enter their IDX's here. For the sensor types
IDX_TEMP_1=206
IDX_TEMP_2=198
IDX_TEMP_3=197
IDX_TEMP_4=

if ping -c 1 $IPX800 > /dev/null ; then  # if host is online then
	#Retrieve temperatures from IPX800
	curl --silent http://$IPX800/status.xml > $LOGFILE

	TEMP_1=$(cat $LOGFILE | grep "<analog0>" | cut -d ">" -f 2 | cut -d "<" -f 1)
	TEMP_1=$(echo 'scale=1;'"$TEMP_1*0.323-50.1" | bc | awk '{printf("%.1f\n", $1)}')
	#echo $TEMP_1

	TEMP_2=$(cat $LOGFILE | grep "<analog1>" | cut -d ">" -f 2 | cut -d "<" -f 1)
	TEMP_2=$(echo 'scale=1;'"$TEMP_2*0.323-50.1" | bc | awk '{printf("%.1f\n", $1)}')
	#echo $TEMP_2

	TEMP_3=$(cat $LOGFILE | grep "<analog2>" | cut -d ">" -f 2 | cut -d "<" -f 1)
	TEMP_3=$(echo 'scale=1;'"$TEMP_3*0.323-50.1" | bc | awk '{printf("%.1f\n", $1)}')
	#echo $TEMP_3

	for i in 1 2 3
		do
			#report Temperature
			eval IDX='$'IDX_TEMP_$i
			eval TEMP='$'TEMP_$i
			curl --silent $DOMOTICZSERVER:$DOMOTICZPORT'/json.htm?type=command&param=udevice&idx='$IDX'&svalue='$TEMP > /dev/null
		done

else
	echo "IPX800 not responding to ping, is it connected to LAN?"
fi
This one is a bit more engaging.
Need to modify the crontab, need to install bc in order to perform math operations, need to write in log file that is setup on a ram disk that turns to be a USB key in order to avoid SD card wear.

Crontab (refresh value every 3 minutes)

Code: Select all

*/3 * * * * (/home/pi/domoticz/scripts/getTemp.sh)
What delay do you have on the outputs?

Re: Add support for IPX800, a standalone relay webserver

Posted: Tuesday 30 October 2018 13:38
by laco
Hello.
I also have an IPX800 relay.
I have a Domotitz server installed on Synology.
I'm trying to add here, could someone help me?
What hardware should I add?
Which switch should I choose?
Where do I put the basch script for analog inputs?

Well thank you.

Re: Add support for IPX800, a standalone relay webserver

Posted: Thursday 01 November 2018 13:17
by laco
Relay I managed to add
hardware:
Dummy (Does not use virtual switches only)
Add next:
Create Virtual Sensor
Choose:
Switch Type: On / Off
On Action:
http://192.168.1.125/preset.htm?led1=1
  Off Action:
http://192.168.1.125/preset.htm?led1=0

I now control the relay. :D

:( Next I can not move, I need to retrieve data from IPX800 v1, pro, v3
I have 8 analogue sensors, 1 counter and 6 digital sensors

Will someone help me? I am willing to pay for your help.

Re: Add support for IPX800, a standalone relay webserver

Posted: Sunday 04 November 2018 9:37
by laco
I created a virtual IDX16 and IDX17 thermometer

I have used the LM35Z temperature sensor an1 in IPX800
Temperature calculation an1 * 0.323

Status XML IPX800:

Code: Select all

<response>
<led0>1</led0>
<led1>1</led1>
<led2>0</led2>
<led3>0</led3>
<led4>0</led4>
<led5>0</led5>
<led6>0</led6>
<led7>0</led7>
<btn0>up</btn0>
<btn1>up</btn1>
<btn2>up</btn2>
<btn3>up</btn3>
<an1>69</an1>
<an2>54</an2>
<time0>08:35:41</time0>
</response>
I used the script getTemp.sh

Code: Select all

#!/bin/bash                                                                     
IPX800=192.168.1.125
LOGFILE="/volume1/@appstore/domoticz/var/scripts/ipx800.log"
DOMOTICZSERVER=192.168.1.200
DOMOTICZPORT=8084
#Create virtual sensors in Domoticz and enter their IDX's here. For the sensor types
IDX_TEMP_1=16
IDX_TEMP_2=17
if ping -c 1 $IPX800 > /dev/null ; then  # if host is online then
#Retrieve temperatures from IPX800
curl --silent http://$IPX800/status.xml > $LOGFILE
TEMP_1=$(cat $LOGFILE | grep "<an1>" | cut -d ">" -f 2 | cut -d "<" -f 1)
TEMP_1=$(echo 'scale=1;'"$TEMP_1*0.323-50.1" | bc | awk '{printf("%.1f\n", $1)}')
#echo $TEMP_1
TEMP_2=$(cat $LOGFILE | grep "<an2>" | cut -d ">" -f 2 | cut -d "<" -f 1)
TEMP_2=$(echo 'scale=1;'"$TEMP_2*0.323-50.1" | bc | awk '{printf("%.1f\n", $1)}')
#echo $TEMP_2
for i in 1 2
do
#report Temperature
eval IDX='$'IDX_TEMP_$i
eval TEMP='$'TEMP_$i
curl -s '$DOMOTICZSERVER:$DOMOTICZPORT'/json.htm?type=command&param=udevice&idx='$IDX'&svalue='$TEMP > /dev/null
done
else
echo "IPX800 not responding to ping, is it connected to LAN?"
fi
I created Cron to run: bash /volume1/@appstore/domoticz/var/scripts/getTemp.sh

Current status: 2 (Suspended)
Standard Output / Error:

/volume1/@appstore/domoticz/var/scripts/getTemp.sh: line 23: syntax error near unexpected token `eval'
/volume1/@appstore/domoticz/var/scripts/getTemp.sh: line 23: `eval IDX='$'IDX_TEMP_$i

And I'm probably done here. The previous script was for raspberry pi.
Will anyone help me to create a synology script?

Re: Add support for IPX800, a standalone relay webserver

Posted: Sunday 04 November 2018 11:57
by waaren
laco wrote: Sunday 04 November 2018 9:37 I created a virtual IDX16 and IDX17 thermometer
I have used the LM35Z temperature sensor an1 in IPX800
Temperature calculation an1 * 0.323

Will anyone help me to create a synology script?
Can you try and change the block

Code: Select all

for i in 1 2
do
#report Temperature
eval IDX='$'IDX_TEMP_$i
eval TEMP='$'TEMP_$i
curl -s '$DOMOTICZSERVER:$DOMOTICZPORT'/json.htm?type=command&param=udevice&idx='$IDX'&svalue='$TEMP > /dev/null
done
to the lines

Code: Select all

curl -s '$DOMOTICZSERVER:$DOMOTICZPORT'/json.htm?type=command&param=udevice&idx='$IDX_TEMP_1'&svalue='$TEMP_1 > /dev/null
curl -s '$DOMOTICZSERVER:$DOMOTICZPORT'/json.htm?type=command&param=udevice&idx='$IDX_TEMP_2'&svalue='$TEMP_2 > /dev/null

Re: Add support for IPX800, a standalone relay webserver

Posted: Sunday 04 November 2018 14:12
by laco

Code: Select all

Task: Snimac teploty IPX800 akva
Start time: Sun, 04 Nov 2018 14:11:25 GMT
Stop time: Sun, 04 Nov 2018 14:11:26 GMT
Current status: 2 (Interrupted)
Standard output/error:
/volume1/@appstore/domoticz/var/scripts/getTemp.sh: line 21: syntax error near unexpected token `$'do\r''
/volume1/@appstore/domoticz/var/scripts/getTemp.sh: line 21: `do
'
 
 
Sincerely,
Synology DiskStation

Re: Add support for IPX800, a standalone relay webserver

Posted: Sunday 04 November 2018 14:24
by waaren
laco wrote: Sunday 04 November 2018 14:12

Code: Select all

Task: Snimac teploty IPX800 akva
Start time: Sun, 04 Nov 2018 14:11:25 GMT
Stop time: Sun, 04 Nov 2018 14:11:26 GMT
Current status: 2 (Interrupted)
Standard output/error:
/volume1/@appstore/domoticz/var/scripts/getTemp.sh: line 21: syntax error near unexpected token `$'do\r''
/volume1/@appstore/domoticz/var/scripts/getTemp.sh: line 21: `do
'
 
 
Sincerely,
Synology DiskStation
Can you show how your script looks like now ?

Re: Add support for IPX800, a standalone relay webserver

Posted: Sunday 04 November 2018 14:41
by laco

Code: Select all

#!/bin/bash                                                                     
IPX800=192.168.1.125
LOGFILE="/volume1/@appstore/domoticz/var/scripts/ipx800.log"
DOMOTICZSERVER=192.168.1.200
DOMOTICZPORT=8084
#Create virtual sensors in Domoticz and enter their IDX's here. For the sensor types
IDX_TEMP_1=16
IDX_TEMP_2=17
IDX_TEMP_3=
IDX_TEMP_4=
if ping -c 1 $IPX800 > /dev/null ; then  # if host is online then
#Retrieve temperatures from IPX800
curl --silent http://$IPX800/status.xml > $LOGFILE
TEMP_1=$(cat $LOGFILE | grep "<an1>" | cut -d ">" -f 2 | cut -d "<" -f 1)
TEMP_1=$(echo 'scale=1;'"$TEMP_1*0.323-50.1" | bc | awk '{printf("%.1f\n", $1)}')
#echo $TEMP_1
TEMP_2=$(cat $LOGFILE | grep "<an2>" | cut -d ">" -f 2 | cut -d "<" -f 1)
TEMP_2=$(echo 'scale=1;'"$TEMP_2*0.323-50.1" | bc | awk '{printf("%.1f\n", $1)}')
#echo $TEMP_2
for i in 1 2
do
#report Temperature
eval IDX='$'IDX_TEMP_$i
eval TEMP='$'TEMP_$i
curl -s '$DOMOTICZSERVER:$DOMOTICZPORT'/json.htm?type=command&param=udevice&idx='$IDX_TEMP_1'&svalue='$TEMP_1 > /dev/null
curl -s '$DOMOTICZSERVER:$DOMOTICZPORT'/json.htm?type=command&param=udevice&idx='$IDX_TEMP_2'&svalue='$TEMP_2 > /dev/null
done
else
echo "IPX800 not responding to ping, is it connected to LAN?"
fi

Re: Add support for IPX800, a standalone relay webserver

Posted: Sunday 04 November 2018 14:45
by waaren
laco wrote: Sunday 04 November 2018 14:41
Spoiler: show

Code: Select all

#!/bin/bash                                                                     
IPX800=192.168.1.125
LOGFILE="/volume1/@appstore/domoticz/var/scripts/ipx800.log"
DOMOTICZSERVER=192.168.1.200
DOMOTICZPORT=8084
#Create virtual sensors in Domoticz and enter their IDX's here. For the sensor types
IDX_TEMP_1=16
IDX_TEMP_2=17
IDX_TEMP_3=
IDX_TEMP_4=
if ping -c 1 $IPX800 > /dev/null ; then  # if host is online then
#Retrieve temperatures from IPX800
curl --silent http://$IPX800/status.xml > $LOGFILE
TEMP_1=$(cat $LOGFILE | grep "<an1>" | cut -d ">" -f 2 | cut -d "<" -f 1)
TEMP_1=$(echo 'scale=1;'"$TEMP_1*0.323-50.1" | bc | awk '{printf("%.1f\n", $1)}')
#echo $TEMP_1
TEMP_2=$(cat $LOGFILE | grep "<an2>" | cut -d ">" -f 2 | cut -d "<" -f 1)
TEMP_2=$(echo 'scale=1;'"$TEMP_2*0.323-50.1" | bc | awk '{printf("%.1f\n", $1)}')
#echo $TEMP_2
for i in 1 2
do
#report Temperature
eval IDX='$'IDX_TEMP_$i
eval TEMP='$'TEMP_$i
curl -s '$DOMOTICZSERVER:$DOMOTICZPORT'/json.htm?type=command&param=udevice&idx='$IDX_TEMP_1'&svalue='$TEMP_1 > /dev/null
curl -s '$DOMOTICZSERVER:$DOMOTICZPORT'/json.htm?type=command&param=udevice&idx='$IDX_TEMP_2'&svalue='$TEMP_2 > /dev/null
done
else
echo "IPX800 not responding to ping, is it connected to LAN?"
fi
What I meant with my last post is this:

Code: Select all

#!/bin/bash                                                                     
IPX800=192.168.1.125
LOGFILE="/volume1/@appstore/domoticz/var/scripts/ipx800.log"
DOMOTICZSERVER=192.168.1.200
DOMOTICZPORT=8084
#Create virtual sensors in Domoticz and enter their IDX's here. For the sensor types
IDX_TEMP_1=16
IDX_TEMP_2=17
IDX_TEMP_3=
IDX_TEMP_4=
if ping -c 1 $IPX800 > /dev/null ; then  # if host is online then
    #Retrieve temperatures from IPX800  
    curl --silent http://$IPX800/status.xml > $LOGFILE
    TEMP_1=$(cat $LOGFILE | grep "<an1>" | cut -d ">" -f 2 | cut -d "<" -f 1)
    TEMP_1=$(echo 'scale=1;'"$TEMP_1*0.323-50.1" | bc | awk '{printf("%.1f\n", $1)}')
    #echo $TEMP_1
    TEMP_2=$(cat $LOGFILE | grep "<an2>" | cut -d ">" -f 2 | cut -d "<" -f 1)
    TEMP_2=$(echo 'scale=1;'"$TEMP_2*0.323-50.1" | bc | awk '{printf("%.1f\n", $1)}')
    #echo $TEMP_2
    #report Temperature
    curl -s '$DOMOTICZSERVER:$DOMOTICZPORT'/json.htm?type=command&param=udevice&idx='$IDX_TEMP_1'&svalue='$TEMP_1 > /dev/null
    curl -s '$DOMOTICZSERVER:$DOMOTICZPORT'/json.htm?type=command&param=udevice&idx='$IDX_TEMP_2'&svalue='$TEMP_2 > /dev/null
else
    echo "IPX800 not responding to ping, is it connected to LAN?"
fi

Re: Add support for IPX800, a standalone relay webserver

Posted: Sunday 04 November 2018 14:52
by laco
Task: Snimac teploty IPX800 akva
Start time: Sun, 04 Nov 2018 14:50:35 GMT
Stop time: Sun, 04 Nov 2018 14:50:36 GMT
Current status: 0 (Normal)
Standard output/error:
ping: socket: Operation not permitted
ping: socket: Operation not permitted


Sincerely,
Synology DiskStation

Re: Add support for IPX800, a standalone relay webserver

Posted: Sunday 04 November 2018 15:14
by waaren
laco wrote: Sunday 04 November 2018 14:52 Task: Snimac teploty IPX800 akva
Start time: Sun, 04 Nov 2018 14:50:35 GMT
Stop time: Sun, 04 Nov 2018 14:50:36 GMT
Current status: 0 (Normal)
Standard output/error:
ping: socket: Operation not permitted
You should first try these commands (ping and curl) from the CLI as the user that will also execute the script.
Maybe they need to use sudo the be allowed to execute these commands. If so, you also have to adjust the commands in the script.

like

Code: Select all

!/bin/bash                                                                     
IPX800=192.168.1.125
LOGFILE="/volume1/@appstore/domoticz/var/scripts/ipx800.log"
DOMOTICZSERVER=192.168.1.200
DOMOTICZPORT=8084
#Create virtual sensors in Domoticz and enter their IDX's here. For the sensor types
IDX_TEMP_1=16
IDX_TEMP_2=17
IDX_TEMP_3=
IDX_TEMP_4=
if sudo ping -c 1 $IPX800 > /dev/null ; then  # if host is online then
    #Retrieve temperatures from IPX800  
    curl --silent http://$IPX800/status.xml > $LOGFILE
    TEMP_1=$(cat $LOGFILE | grep "<an1>" | cut -d ">" -f 2 | cut -d "<" -f 1)
    TEMP_1=$(echo 'scale=1;'"$TEMP_1*0.323-50.1" | bc | awk '{printf("%.1f\n", $1)}')
    #echo $TEMP_1
    TEMP_2=$(cat $LOGFILE | grep "<an2>" | cut -d ">" -f 2 | cut -d "<" -f 1)
    TEMP_2=$(echo 'scale=1;'"$TEMP_2*0.323-50.1" | bc | awk '{printf("%.1f\n", $1)}')
    #echo $TEMP_2
    #report Temperature
    sudo curl -s '$DOMOTICZSERVER:$DOMOTICZPORT'/json.htm?type=command&param=udevice&idx='$IDX_TEMP_1'&svalue='$TEMP_1 > /dev/null
    sudo curl -s '$DOMOTICZSERVER:$DOMOTICZPORT'/json.htm?type=command&param=udevice&idx='$IDX_TEMP_2'&svalue='$TEMP_2 > /dev/null
else
    echo "IPX800 not responding to ping, is it connected to LAN?"
fi

Re: Add support for IPX800, a standalone relay webserver

Posted: Sunday 04 November 2018 17:40
by laco
Current status: 0 (Normal)
Standard output/error:
/volume1/@appstore/domoticz/var/scripts/getTemp.sh: line 1: !/bin/bash: No such file or directory
cat: /volume1/@appstore/domoticz/var/scripts/ipx800.log
: No such file or directory
/volume1/@appstore/domoticz/var/scripts/getTemp.sh: line 15: bc: command not found
cat: /volume1/@appstore/domoticz/var/scripts/ipx800.log
: No such file or directory
/volume1/@appstore/domoticz/var/scripts/getTemp.sh: line 18: bc: command not found
/volume1/@appstore/domoticz/var/scripts/getTemp.sh: line 23: $'else\r': command not found
IPX800 not responding to ping, is it connected to LAN?