EDS 1-Wire Server Plugin

Posted on
Fri Sep 04, 2015 2:16 pm
jens offline
Posts: 191
Joined: May 03, 2015
Location: Sweden

Re: EDS 1-Wire Server Plugin

Have one 8 Channel relay DS2408

http://www.hobby-boards.com/store/products.php?product=8-Channel-I%7B47%7DO-%288-Relay-Version%29

How do I turn on and off relays in Indigo?

and how I see what input is active?

//Jens

Posted on
Fri Sep 04, 2015 3:25 pm
DaveL17 offline
User avatar
Posts: 3427
Joined: Aug 20, 2013

Re: EDS 1-Wire Server Plugin

Does the board communicate with an EDS OW-SERVER (rev 1 or rev 2)? This plugin is purpose-built to read the XML output of those devices specifically. If it does, please PM a copy of the details.xml file to me and I'll see if it can be included.

More broadly, I have a longer-term plan to see if it's possible to send commands to compatible relays, and to user-writable elements of compatible chips. At the moment, I'm not sure how feasible that is.

Dave

Posted on
Mon Sep 07, 2015 4:48 am
DaveL17 offline
User avatar
Posts: 3427
Joined: Aug 20, 2013

Re: EDS 1-Wire Server Plugin

jens wrote:
Have one 8 Channel relay DS2408

http://www.hobby-boards.com/store/products.php?product=8-Channel-I%7B47%7DO-%288-Relay-Version%29

How do I turn on and off relays in Indigo?

and how I see what input is active?

//Jens

Hi Jens - thanks for sending along the details.xml file with the 8-channel switch installed. Unfortunately, it doesn't look like the switch is fully supported by the OW-SERVER. There's nothing within the xml data pointing to the status of the switches that I can key off on. (There may be a way to divine the state of the 8 switches from the PIO Logic State or the Raw Value, but I haven't been able to find one.) Here is the relevant XML segment for the device:
Code: Select all
<owd_DS2408 Description="8-Channel Addressable Switch">
<Name>DS2408</Name>
<Family>29</Family>
<ROMId>SNIP</ROMId>
<Health>7</Health>
<Channel>2</Channel>
<RawData>
FFFF00000088000000000000EB9A02000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100
</RawData>
<PrimaryValue>255</PrimaryValue>
<PIOLogicState>255</PIOLogicState>
<PIOOutputLatchState Writable="True">255</PIOOutputLatchState>
<PIOActivityLatchState Writable="True">0</PIOActivityLatchState>
<RSTZconfiguration Writable="True">0</RSTZconfiguration>
<PowerOnResetLatch Writable="True">1</PowerOnResetLatch>
<VccPowerStatus>1</VccPowerStatus>
</owd_DS2408>

This old thread makes it sound like the board isn't natively supported:

https://code.google.com/p/openhab/issues/detail?id=438

For now, it doesn't seem that there's much I can do to support this board.
Dave

Posted on
Mon Sep 07, 2015 11:35 pm
jens offline
Posts: 191
Joined: May 03, 2015
Location: Sweden

Re: EDS 1-Wire Server Plugin

Okey, Dave Thanks for trying..


Sent from my iPhone 6 using Tapatalk

Posted on
Tue Sep 08, 2015 3:43 am
DaveL17 offline
User avatar
Posts: 3427
Joined: Aug 20, 2013

Re: EDS 1-Wire Server Plugin

jens wrote:
Okey, Dave Thanks for trying..

Certainly. There may be a facility down the road to send commands to the OW-SERVER with the plugin...
Dave

Posted on
Tue Sep 08, 2015 1:11 pm
jens offline
Posts: 191
Joined: May 03, 2015
Location: Sweden

Re: EDS 1-Wire Server Plugin

Hello again Dave,

What do you think of this one?
http://www.ebay.com/itm/NEW-DS2408S-1-Wire-8-Channel-Addressable-Switch-Relay-Board-Latest-DS2408-/181561020588

it stands on OW server site that they support it
http://www.embeddeddatasystems.com/Ethernet_c_39.html

Never give up :D

//Jens

Posted on
Tue Sep 08, 2015 7:12 pm
DaveL17 offline
User avatar
Posts: 3427
Joined: Aug 20, 2013

Re: EDS 1-Wire Server Plugin

Hi Jens - my concern is that the XML return would be similar to the other one. I'd encourage you to find someone that's successfully used this board with the EDS server. But that said, I've been thinking about what might be happening with the data returned. Hopefully, some of the real programmers here can help explain what I'm about to try to explain using the proper language! :D

There are 8 relays on the board. If we assign an enumerated value to each relay like so:
Code: Select all
list_of_relays = [
    ('P7',128),
    ('P6',64),
    ('P5',32),
    ('P4',16),
    ('P3',8),
    ('P2',4),
    ('P1',2),
    ('P0',1)
    ]

and then if (and it's a big if) the returned data reports the combined relay states as a value between 0 - 255 (status_count), then I can tell you which relays are active using something like this:
Code: Select all
active_relays = []

for relay in list_of_relays:
    if (status_count - relay[1]) >= 0:
        active_relays.append(relay[0])
        status_count = status_count - relay[1]

print active_relays

So for example, if status_count = 123, I can tell that it's relays ['P0', 'P1', 'P3', 'P4', 'P5', 'P6'] that are active (64+32+16+8+2+1 = 123).

All of this is conjecture and wishful thinking, mind you. I have no proof that this is how it actually works. Without concrete proof that your proposed board is supported and the server provides useful XML output--I can make no guarantees.
Dave

Posted on
Tue Sep 08, 2015 10:46 pm
jens offline
Posts: 191
Joined: May 03, 2015
Location: Sweden

Re: EDS 1-Wire Server Plugin

I bought it, think it is worth to try :) or what do you say :roll:

But took this model, if it work´s, it is easier when there is a din rail mounting on,

http://denkovi.com/1-wire-eight-channel-relay-module-for-home-automation-with-din-box

//Jens

Posted on
Wed Sep 09, 2015 5:38 am
DaveL17 offline
User avatar
Posts: 3427
Joined: Aug 20, 2013

Re: EDS 1-Wire Server Plugin

Hi Jens - There must be a way to control these devices (otherwise, what's the point of them?), I just don't know how that's done quite yet.

Perhaps we can figure this out together! :D

Posted on
Tue Sep 15, 2015 1:53 pm
DaveL17 offline
User avatar
Posts: 3427
Joined: Aug 20, 2013

Re: EDS 1-Wire Server Plugin

Hi Jens - I have made inroads on sending data from the plugin back to the server and will roll this functionality into the next release.

Please let me know what you see when you hook up your new device to the network. Perhaps there are some tests that we can run to figure out how best to accomplish full integration.

Dave

Posted on
Sun Sep 27, 2015 8:06 pm
DaveL17 offline
User avatar
Posts: 3427
Joined: Aug 20, 2013

Re: EDS 1-Wire Server Plugin

I just wanted to update the information in this thread regarding how to interpret the information on the 8 channel switch. Here is some information from the very helpful cats at EDS:

Helpful EDS Cats wrote:
The OW-SERVER can set the output state of the DS2408 to any value between 0 to 255 (decimal) which corresponds with 0000 0000 to 1111 1111 (binary). Each bit represents the output state of one of the eight channels (0 through 7). Each channel with a bit equal to 0 is conducting. Each channel with a bit equal to 1 is nonconducting. Here are a few examples:

0 (Decimal) = 0000 0000 (Binary) sets all outputs to ON
128 (Decimal) = 1000 0000 (Binary) sets channel 7 to OFF, sets channels 0 through 6 to ON
170 (Decimal = 1010 1010 (Binary) sets channels 7,5,3 & 1 to OFF, sets channels 6,4,2 & 0 to ON


It's very easy to figure out the numbers we need using the OS X calculator. First, you need to change the View to "Programmer." If the binary window isn't showing, click on "Show Binary." Also, be sure to set the calculator to base 10. Then you can either enter the number directly, or if you want to, you can click directly on the binary values and the number will appear. In the image below, I typed in the value of "170" and you can see the binary representation in the lower right of the binary window. Note that the bits correspond to the outputs from right to left (output zero is the right most bit.)

Dave
Attachments
Screen Shot 2015-09-27 at 8.35.32 PM.png
Screen Shot 2015-09-27 at 8.35.32 PM.png (114.35 KiB) Viewed 1156 times

Posted on
Mon Sep 28, 2015 4:03 am
DaveL17 offline
User avatar
Posts: 3427
Joined: Aug 20, 2013

EDS 1-Wire Server Plugin

Here is a very quick and dirty Python decoder ring. Place the value (from 0 to 255) into the variable x:

Code: Select all
x = [---VALUE---]

counter = 7
switch_dict = {}
x_binary = int(bin(x)[2:])
x_binary_str = str(x_binary)
x_binary_str = x_binary_str.zfill(8)

print u"%s  =  %s\n" % (x, x_binary_str)

for switch in x_binary_str:
    switch_name = u"S%s" % counter
    switch_dict[switch_name] = switch
    counter -= 1

for thing, value in reversed(sorted(switch_dict.iteritems())):
    print thing, value

For example, if x = 170:
Code: Select all
170  =  10101010

S7 1
S6 0
S5 1
S4 0
S3 1
S2 0
S1 1
S0 0

All this is to add to the discussion with Jens above; this will all be baked into the plugin at the point where I add bi-directional communication.
Dave

EDIT: adds zfill to ensure all binary numbers are padded to 8 characters in length.

Posted on
Mon Sep 28, 2015 4:28 am
jens offline
Posts: 191
Joined: May 03, 2015
Location: Sweden

Re: EDS 1-Wire Server Plugin

Hello Dave,

Have now connect the new 8chanel switch and get this from the XML file

<owd_DS2408 Description="8-Channel Addressable Switch">
<Name>DS2408</Name>
<Family>29</Family>
<ROMId>B300000016475129</ROMId>
<Health>7</Health>
<Channel>1</Channel>
<RawData>
0000FF000088000000000000EB9A02000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100
</RawData>
<PrimaryValue>0</PrimaryValue>
<PIOLogicState>0</PIOLogicState>
<PIOOutputLatchState Writable="True">0</PIOOutputLatchState>
<PIOActivityLatchState Writable="True">255</PIOActivityLatchState>
<RSTZconfiguration Writable="True">0</RSTZconfiguration>
<PowerOnResetLatch Writable="True">1</PowerOnResetLatch>
<VccPowerStatus>1</VccPowerStatus>
</owd_DS2408>
</Devices-Detail-Response>

Any help?

//JEns

Posted on
Mon Sep 28, 2015 5:57 am
DaveL17 offline
User avatar
Posts: 3427
Joined: Aug 20, 2013

Re: EDS 1-Wire Server Plugin

Hi Jens - I think so, yes. Thanks to the guys at EDS, I'm much smarter about the DS2408 than I was a week ago.

And thanks to you for sharing this XML. I will send you a couple of things to try in a short while.

Dave


Sent from my iPhone using Tapatalk

Posted on
Mon Sep 28, 2015 6:05 am
jens offline
Posts: 191
Joined: May 03, 2015
Location: Sweden

Re: EDS 1-Wire Server Plugin

Have now test the 0, 128, 170, and it works,


Name DS2408
Description 8-Channel Addressable Switch
Family 29
ROMId B300000016475129
Health 7
Channel 1
RawData 8080AA000088000000000000EB9A020001000100010001000100010001000100...
PrimaryValue 128
PIOLogicState 128
PIOOutputLatchState 128 Write
PIOActivityLatchState 170 Write
RSTZconfiguration 0 Write
PowerOnResetLatch 1 Write
VccPowerStatus 1

//Jens

Who is online

Users browsing this forum: No registered users and 1 guest

cron