Jump to content

Digital I/O


salex319

Recommended Posts

I modify things around my house all the time so the number varies but I could use about 6 right now. For example I currently can tap a discrete that indicates if my front door is open or not. I would like to use that to turn on my front porch light which is controlled by an Insteon switch. I know I can do that with Insteon devices but it's expensive and inconvenient. If there was some other way to get discretes into the ISY it would be great. If I could aggregate these signals and then send them using RS-232 or Ethernet Sockets or if Insteon had a device that would take multiple low voltage inputs - say like 8 - those would all be nice alternatives.

Link to comment

Also, CAI Webcontrol Board, a Raspberry Pi or Arduino boards can all talk to the ISY via its API (with a little code) and can have digital IO lines connected. You only need the network module on ISY if you want ISY to send network commands to such devices.

Link to comment

I've taken a quick look at the Network Module but don't see an API that would facilitate me sending simple Ethernet messages to trigger programs or change variables. If someone could point me to that it would be brilliant. I'm already running code on a RPi that works with my PCs and various sensors around my house so adding the ISY capability would be amazing.

Link to comment
21 minutes ago, salex319 said:

I've taken a quick look at the Network Module but don't see an API that would facilitate me sending simple Ethernet messages to trigger programs or change variables. If someone could point me to that it would be brilliant. I'm already running code on a RPi that works with my PCs and various sensors around my house so adding the ISY capability would be amazing.

Define sending simple Ethernet messages?

The network module provides the ability to perform HTTP GET/POST as well as performing direct TCP, UDP and Multicast

image.thumb.png.1d9e64910f5937802c5800c9bbc2aff3.png

Link to comment

The Network Module can send almost any style of Ethernet packet out. The Rest interface inside ISY can receive formatted Ethernet packets to control programs, variables, scenes etc..

The CAI WC8 board would fit your bill perfectly. it would take only a few lines of code and rest interface commands installed into it's table to write to ISY from the logic inputs on the WC8 board.

532539275_WC8Notificationpage.jpg.9ca266df3e5d3a8041f530088847a340.jpg

Link to comment
1 hour ago, salex319 said:

I've taken a quick look at the Network Module but don't see an API that would facilitate me sending simple Ethernet messages to trigger programs or change variables. If someone could point me to that it would be brilliant. I'm already running code on a RPi that works with my PCs and various sensors around my house so adding the ISY capability would be amazing.

You DON'T need the network module on ISY to be able to receive inbound API requests to 'trigger programs' or 'change variables'. This is base functionality in ISY.

For details of the REST API that ISY has, see https://wiki.universal-devices.com/index.php?title=ISY_Developers:API:REST_Interface

1.6 documents programs, and 1.8 documents variables.

You ONLY need the ISY Network module if you want the ISY to initiate outbound network messages to other systems...

Link to comment

Based on what I see here my ideal solution is what MWareman has suggested. It will take me some time to research and understand how to use the REST API from my Raspberry Pi using Python. If anyone has seen any examples of this and could point me to them that would be great. Thanks for all the input.

Link to comment
17 hours ago, salex319 said:

(Based on what I see here my ideal solution is what MWareman has suggested. It will take me some time to research and understand how to use the REST API from my Raspberry Pi using Python. If anyone has seen any examples of this and could point me to them that would be great. Thanks for all the input.

For the CAI Webcontrol board you don't need a RPi at all. See my screenshot (above) as the WC8 board has it's own I/o interface designed to  support ISY's Rest interface without any further hardware.

Link to comment

I already have a Raspberry Pi running code that aggregates a number of sensors and devices around my house. If I can add some code to integrate that with my ISY that would be ideal. I'm looking at Polyglot right now which appears to be what I want but having problems getting it set up. Anyway I'll keep the CAI Webcontrol  Board as an option so thanks for that.

Link to comment
On 5/29/2019 at 9:46 PM, salex319 said:

I already have a Raspberry Pi running code that aggregates a number of sensors and devices around my house. If I can add some code to integrate that with my ISY that would be ideal. I'm looking at Polyglot right now which appears to be what I want but having problems getting it set up. Anyway I'll keep the CAI Webcontrol  Board as an option so thanks for that.

import urllib.request
import base64

# Server (this CPU) IP address
server_IP = '192.168.0.175' 
server_port = 8000

# ISY  parameters to be defined by user
ISY_username = 'zzzzzzz'
ISY_password = 'xxxxxxxx'
ISY_IP = '192.168.0.161'

# Heartbeat to ISY variable
ISY_HBpage = 2  # 1=Integer, 2=State
ISY_HBaddr = 83 # ISY heartbeat variable
ISY_HBperiod = 90 # In seconds. toggles ISY flag variable
ISY_HBlast_sent = 0.0

 

# Write ISY handshake variable via REST i/f
def write_ISY(data):
    ISY_rest = "/rest/vars/set/%s/%s/%s" % (ISY_HBpage, ISY_HBaddr, data)
    get_url = urllib.request.Request('http://' + ISY_IP + ISY_rest) #format the URL
    ISY_authorise = base64.b64encode((ISY_username+":"+ISY_password).encode('utf-8')) #encode it
    get_url.add_header("Authorization", 'Basic %s' % ISY_authorise.decode('utf-8'))
    try:
        r = urllib.request.urlopen(get_url)
        returned = r.read()
        r.close()
    except:
        report("NRBridge: ISY heartbeat send failed!***")
    return
 

Link to comment

Just a word of caution, to save some frustration, when using the WC8 Webcontrol board. Please note the WC8 board from a "practical" standpoint only supports one digital "one-wire" temperature device and the humidity one wire device if you are using the WC8 to "webset" variables to the ISY, as described earlier in this thread, and have it doing other logic besides. If you wish to use multiple one-wire temperature sensors you should either add additional WC8 boards, or reduce the programing in the WC8 to the minimum required to get the task done. I have been using two of the WC8 for well over three years and have found them to be the only simple practical way (besides perhaps a PI) to get digital and analog I/O points into the ISY. I have found that using more than one wire temperature device will cause board lock ups and the failure of all, or all but one, of the one wire temperature points. I also recommend sending "webset" variables to the the ISY at one minute or longer intervals to reduce load on the WC8 board. Hope this helps with the planning and setup of your project.

Please note earlier topics, (CAI Web Control loses Temperature Configuration along with other topics on the  "CAI Web Control to ISY Integration" section of this board) about getting digital and analog inputs into the ISY.

Link to comment

The WC8 supports up to 16 x 1-Wire devices. Early WC8 models had some trouble with this feat but this has been reported to be resolved mostly. Some experimenting with the 1wire transmission line terminations may be required to make it work properly with multiple 1wire devices. Mine has a resistor and capacitor installed at the board. Other users here report 16 probes successfully with ISY.

My older WC8 board has worked with 2 x 1-wire temperature probes for several years while it counts pulses from my anemometer, calculating wind speeds and wind gusts, while sending 8 Webset packets to my ISY every 20 seconds, no problem. I was sending 8 Webset packets to ISY every 10 seconds but wanted to lengthen my sample period for the wind calculations.

ISY has no problems handling a Webset packet from the WC8 every second while it performs many other tasks simultaneously, like PolyGlot plus NodeLink and several other home brew RPi projects updating variables.

Link to comment

I was never able to achieve that degree of success with my older WC8 boards. I would like to know what values you use for the resistor and capacitor at the one wire input at the board. Maybe that will also reduce the lockups and reboots I experience with my WC8 board. It would be worth a try.

My problems with Webset packets being sent too quickly wasn't at the ISY end but rather to keep my WC8 board from locking up. I have a watchdog in the ISY to alert me and counter to keep track of the WC8 and to have the ISY cycle power to the WC8 as needed. This ISY is still at the 4.7.3 revision. Both of these operate at a remote location three to four hours away.

The home WC8 monitors a sump pump and has just one one-wire temperature and a one-wire humidity sensor and it has never had a problem. And I have never had either ISY lockup to the point where they stopped running their programs. PLM problems and losing the ability to communicate with the remote ISY from home is another matter.

What I have found to be reliable for my sump monitoring (at the home location) is the Control by web family of products but they are Modbus only, with the exception that the ISY can send output requests to their relay outputs via network resources. This way the WC8 and the Control by web backs up each other. Once a version 5 release for ISY becomes official I would like to try the node server solution to get an input from the Control by web products to the ISY. I want to keep the component/device count at the remote location as low as possible to keep the reliability at an acceptable level. Then I will plan to look at the node server topics to try to figure that out and likely ask questions there.

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...