Author Topic: Plugin : IPX800 card for generic use  (Read 8895 times)

Offline amg0

  • Master Member
  • *******
  • Posts: 3057
  • Karma: +206/-8
Plugin : IPX800 card for generic use
« on: November 14, 2014, 06:22:13 am »
Hello , I use a IPXv800 relay card from GCE Electronics company. It is a nice board with an embedded web server to control 8 output relays, 8 digital inputs, 4 analog inputs. It can be extended with some extensions cards to manage up to 32 relays / inputs and 16 analog inputs
http://gce-electronics.com/en/

I only found a vera plugin for controlling window covers with it but nothing for the generic useage of relays & inputs.
so after the IPhoneLocator plugin, I decided to create my second real plugin for vera/UI5 ( not testable by me on UI7 ) which basically exposes the relays and the analog inputs as classical devices on VERA. The advantage of this approach is that these classical devices are then visible in any vera client app ( like phones etc )

The approach is also to limit configuration inside VERA and reuse as much as possible all the configuration and parameters set in the IPX800 configuration. for instance VERA device names are imported from the IPX configuration

Version 0.38

Features
  • UI5 / UI7 compatible
  • the Ipxv800 device, is creating child devices in any room you want for each element we want to control.
  • reachability of the Ipx800 device is reported and reachable/not reachable are events useable in scenes/notifications
  • dynamic icons for the ipx800 device based on its reachability
  • Controls the on/off status of the 1..32 relays via a classic power switch device.
  • Supports a window covers as a dimmer device, use of 3 ipx relays ( up , stop and down ) in pulse mode. Supports intermediate positions of window cover
  • respects configuration inside the IPX800, if a relay is programmed inside IPX800 to be a pulse ( Tb <> 0 ) it will trigger a pulse
  • Expose the 1..16 analog inputs values as either a temperature sensor , light sensor or humidity sensor device and display the correct value according to IPX800 sensor configuration
  • Expose the 1..32 digital inputs as either a power switch device or a Motion detector device and display the correct status according to IPX800 digital input state
  • Controllable set of relays/analog/input which needs to be exposed in the Vera ( not necessarily needed to expose all the relays/analogs/inputs ). You can change device names/titles but DO NOT change the altid please.
  • configuration enables choice of update mechanism between these options. ( vera poll + ipx push is possible (& recommended) at the same time)
          
    • scheduled polled from VERA to IPX for update of status with controllable frequency in seconds
    • only manual refresh based on "refresh" uPNP action & UI button (for use in scenes)
    • Direct Push update from IPX800 if configured in IPX ( server=your vera ip,  port=3480, Enable checkbox checked, Path = /data_request?id=lr_IPX800_Handler&mac=$M&deviceID=nnn where nnn is the vera device ID.
       
  • UI5 dashboard
          
    • firmware of the ipx800
    • button to force a data refresh
    • button to trigger the import of names from IPX800
    • in Control tab, button to switch DEBUG mode state
       
  • SETTINGS js tab
          
    • facilitate entry of parameters with Regular expression checking for format of parameters. Dynamic save of changes in the Setting tabs.
    • Button to test connectivity
    • Button to open IPX web UI for configuration
       

Variables
Service : urn:upnp-org:serviceId:IPX8001
  • Debug: email address used in iCloud account
  • Version: version of the plugin
  • Present: 1 if the IPX card is reachable, 0 otherwise
  • IconCode: 100 when the device is reachable, 0 otherwise. controls the icon display on UI5 dashboard
  • IpxIpAddress:ip address of the ipx800 card
  • FirmwareVersion:reported firmware version of the ipx800 card
  • User: user of the basic authentication of the HTTP interface to the card ( WARNING read below )
  • Password: password for above. ( WARNING read below )
  • UpdateFrequency: in sec, refresh frequency for getting data, or 0 for manual mode (using Refresh action from a scene or script). Push mode update from IPX can also be setup in the IPX configuration, see the Settings tab for explanation. Both Poll & Pusg mode can coexist
  • OutputRelays:a comma separated list of relay number to report in VERA. for instance "1,4" to only see relay 1 and relay 4. optionaly use W letter to make a window cover device with this syntax. 1W-2-3-30-40 where 1 is the relay for up command, W is the type ( window ), 2 is the relay for stop commmand, 3 is the relay for down command, 30 is the up cycle , 40 (optional) is the down cycle duration in sec. Window cover requires that you configure your IPX relays in Pulse mode (Tb parameter)
  • InputRelays:a comma separated list of digital input number to report in VERA. for instance "1,4" to only see input 1 and input 4. Optionally each number can be followed by a letter to force a device type. P for powerswitch, M for motion sensor. example  1M,2P
  • AnalogInputs:acomma separated list of relay number to report in VERA. for instance "1,2" to only see analog 1 and 2.Optionally each number can be followed by a letter to force a device type. T for Temp sensor, L for light sensor, H for humidity sensor. example  1T,2L,3,4H

Notifications
  • "Connection State" : When the device becomes reachable or not reachable, in no repeat mode
  • Notification on child devices can be set ( like when temp goes above a certain level etc )


uPNP Actions
  • action "Refresh" : for forcing a refresh of data from the IPX to Vera.
  • action "GetPresent" : for reporting if the IPX800 card is reachable or not
  • action "IPXNames" : Read the configured relay/sensor names in IPX800 and set vera device names accordingly. works on previous firmware if you did not customize it on the IPX but on IPX firmware >=3.05.46 it takes advantage of the new ioname.xml page for that.
  • action "SetDebug" : Set or unset DEBUG mode
  • special "Handler" : to enable IPX to trigger refreshes in a Push mode

WARNING
  • Basic authentication does not work. it is because of the IPX800.  Vera always sends the Basic authentication information in lower case letter in the http header like the standard requires and the IPX800 card expects it with a capital "A". no easy workaround except changing code on the VERA which I refuse to do (for now ).   SO: do not use user / password on your IPX800 card and in this plugin. this is coded, ready to be used for the day GCE fixes their http server side.
  • this has been fixed by GCE with their latest firmware >= 3.05.46. I tested Basic authentication from the plugin to the IPX with this version and it works
  • v0.38 reads status.xml page as a fallback plan for card with older firmware than 3.05.38 but still with http support

Install

Final thx to all authors of plugin from which I stole some snipset of code here and there, the list is too long to share here.

Feedbacks are welcomed and if this generates enough interest, I ll see if we can create a sub forum for it, for now, let's use this thread

Enjoy...
« Last Edit: August 14, 2015, 06:49:00 am by amg0 »

Offline amg0

  • Master Member
  • *******
  • Posts: 3057
  • Karma: +206/-8
Re: New Plugin - IPX800 card for generic use
« Reply #1 on: November 18, 2014, 12:33:39 pm »
Public in the app store now: http://apps.mios.com/plugin.php?id=7426

Offline a-lurker

  • Hero Member
  • *****
  • Posts: 859
  • Karma: +63/-8
Re: New Plugin - IPX800 card for generic use
« Reply #2 on: November 18, 2014, 06:00:17 pm »
A lot of work in your plugin. Great effort.

The hardware looks pretty good as well but as you have found, it appears to have the software http upper/lowercase header problem. The hardware manual indicates that the microchip stack is in use:

http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2680&dDocName=en537041
http://ww1.microchip.com/downloads/en/DeviceDoc/tcpipstk.pdf
http://ww1.microchip.com/downloads/en/AppNotes/00833c.pdf

Just need to hunt through the 300 meg of their framework code to find the bug. :o

So potentially a lot of PICs out there that won't talk to Vera.



« Last Edit: November 20, 2014, 02:49:34 am by a-lurker »

Offline integlikewhoa

  • Master Member
  • *******
  • Posts: 5623
  • Karma: +157/-380
Re: New Plugin - IPX800 card for generic use
« Reply #3 on: November 18, 2014, 06:13:50 pm »
This thing seems pricey and looks like only in Europe?

Whats the advantage of using this?

Offline amg0

  • Master Member
  • *******
  • Posts: 3057
  • Karma: +206/-8
Re: New Plugin - IPX800 card for generic use
« Reply #4 on: November 19, 2014, 01:13:38 pm »
This thing seems pricey and looks like only in Europe?
Whats the advantage of using this?

http://gce-electronics.com/en/

it is kind of the toy for electronic/electric kind of guy , where vera is more the toy for computer guys :-) I am more the computer guy so I use a lot vera and much more basically use for my ipx800. I cannot solder 2 things together almost so wont do complex stuff.

Joke aside, you control relays , dry contact inputs for receiving inputs from motion detectors, switches etc... , 4 analog inputs where you plug in thinkgs like sensors or dials, any kind of toy you build, the analog is essentially a volmeter and the IPX800 tells you the voltage, which depending on the sensor type you translate into a temperature, a PH, a humidity rate whatever.  People do tons of crazy things with it and 8 inputs + 8 output + 4 analog + pulse counters ( for energy counter which or water valve counter which sends a pulse ) is not that pricy. fully http controllable. They just released a product which enables the main card and the extension to be connected via a 1000 m cable !

you can plug to it up to 3 extensions thus giving you 32 relays, 32 inputs, 16 analogs, 16 counters etc...
Stored on a DIN rack in your electricity counter, it is not hard to control many of your lights, power wall plugs etc just by wiring the cable & relay to it.

it has simple rules & scheduling capabilities so you can program when a relay is on or off based on a timer or a input or a value of an analog

Personally : I control my swimming pool
- I can force the pump on or off indedently of the mecanical clock controller
- I can force the cleaner robot on or off indedently of the mecanical clock controller
- I control external temperature
- I control temperature of the pipes ( to get an idea of temp of water in the pipe )
- I trigger pump on when temperatures goes close to 0 C to avoid freezing in the pipes
- I control a RF module to open / close my house gate
- I control the gate external lights

last idea, you have a electrical bell in your house, just open the push button , add 2 wires from the button connectors into the relays connectors on the board and you make your bell ring , on demand, with a http call, when let's say a motion detector detects something outside your house...

Now with this plugin , I can do all that from Vera and within scenes !


« Last Edit: November 19, 2014, 01:15:51 pm by amg0 »

Offline integlikewhoa

  • Master Member
  • *******
  • Posts: 5623
  • Karma: +157/-380
Re: New Plugin - IPX800 card for generic use
« Reply #5 on: November 19, 2014, 01:19:58 pm »
I have an alarm panel which is cheaper and has a ton of inputs, I also have arduino. Trying to figure out where this fits in.

Seems really pricey. Other thing is to many inputs and output in one place means alot of wiring in the house to get the sensor spread out threw the house.

Where if you split it up into 4 channel here then wireless to another 4 over there seems to make more sense.

Curious to see how this 200.00 modual is used.

Offline amg0

  • Master Member
  • *******
  • Posts: 3057
  • Karma: +206/-8
Re: New Plugin - IPX800 card for generic use
« Reply #6 on: November 19, 2014, 03:01:53 pm »
I have an alarm panel which is cheaper and has a ton of inputs, I also have arduino. Trying to figure out where this fits in.

Seems really pricey. Other thing is to many inputs and output in one place means alot of wiring in the house to get the sensor spread out threw the house.

Where if you split it up into 4 channel here then wireless to another 4 over there seems to make more sense.

Curious to see how this 200.00 modual is used.
sure, I see your points. the good news is nobody forces you to buy one ;-)

Offline amg0

  • Master Member
  • *******
  • Posts: 3057
  • Karma: +206/-8
Re: New Plugin - IPX800 card for generic use
« Reply #7 on: November 23, 2014, 10:58:29 am »
Just released a beta version v0.30 which enables the user to chose why type of VERA device he wants to use to expose the IPX relays, analogs and digital inputs.

http://apps.mios.com/test-plugin.php?id=7426&show=versions

Offline amg0

  • Master Member
  • *******
  • Posts: 3057
  • Karma: +206/-8
Re: New Plugin - IPX800 card for generic use
« Reply #8 on: December 02, 2014, 04:52:37 am »
Version 0.30 is public on the store now: http://apps.mios.com/plugin.php?id=7426

Offline amg0

  • Master Member
  • *******
  • Posts: 3057
  • Karma: +206/-8
Re: Plugin : IPX800 card for generic use
« Reply #9 on: December 04, 2014, 09:51:49 am »
Basic Authentication issue fixed by latest GCE firmware >= 3.05.46. I tested Basic authentication from the 0.30 plugin to the IPX with this version and it works.

Offline amg0

  • Master Member
  • *******
  • Posts: 3057
  • Karma: +206/-8
Re: Plugin : IPX800 card for generic use
« Reply #10 on: December 07, 2014, 07:04:39 am »
Version 0.36 is bringing support for:
- humidity sensor & XT400 CT50 analog sensors
- non embedded devices ( child can be put in any room )
- use of ionames.xml from IPX if page is present ( in latest firmware )
- some optimization

Offline amg0

  • Master Member
  • *******
  • Posts: 3057
  • Karma: +206/-8
Re: Plugin : IPX800 card for generic use
« Reply #11 on: December 15, 2014, 01:33:12 pm »
Version 0.38 is public on the store and brings discovery, so even without entering its ip address it should find the canalplus settop box and its ip address by itself ( includes a uPNP UDP workaround found in the DNLA controller plugin ).  in case this does not work you can still enter the IP address directly in the ip variable of the device

Offline amg0

  • Master Member
  • *******
  • Posts: 3057
  • Karma: +206/-8
Re: Plugin : IPX800 card for generic use
« Reply #12 on: December 21, 2014, 05:24:43 pm »
Upgrade 0.39 (private) for better UI7.0.3 display

Offline amg0

  • Master Member
  • *******
  • Posts: 3057
  • Karma: +206/-8
Re: Plugin : IPX800 card for generic use
« Reply #13 on: June 06, 2015, 10:11:06 am »
Pending update on the MIOS Store
  • tested with IPX firmware 3.05.59d
  • added caculated analog values for new sensors like PH & REDOX
  • update to UI7 JSON format to take advantage of new placement logic of controls documented by VERA

will soon be public, otherwise you can install by opening http://<yourip>:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=CreatePlugin&PluginNum=7426&Version=27650 and ignoring error messages

Offline pipoa

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: Plugin : IPX800 card for generic use
« Reply #14 on: July 29, 2015, 12:30:06 pm »
Hello Amg0

I have version 0.43 installed on my vera3 UI5, plugin is working fine.

I recently installed GCE X400 CT module with my IPX800 which sends it signal in Amps on Analog 4 to 8, but my analogue inputs are showing as temperature, how to set it up to read power (Whatts or Amps)

thanks
Philippe