INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: How Many Developers Does It Take?  (Read 46086 times)

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72538
  • Where did I put my teeth?
How Many Developers Does It Take?
« on: March 02, 2016, 06:37:20 pm »

How many developers does it take to turn the lights on?

Today was a big day for JRiver and for Gene Olson, who has been toiling in the dark for months.

Today the lights came on.

Here's a video:



Several times a year something really magical happens here.  This was one of those times.

Left to right: Marshall, Matt, John, and Gene.
Logged

imugli

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1598
Re: How Many Developers Does It Take?
« Reply #1 on: March 03, 2016, 02:28:47 pm »

Congratulations guys!

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72538
  • Where did I put my teeth?
Re: How Many Developers Does It Take?
« Reply #2 on: March 03, 2016, 03:03:05 pm »

Thanks.  It's direct support of a Z-Wave dongle.
Logged

jmone

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 14497
  • I won! I won!
Re: How Many Developers Does It Take?
« Reply #3 on: March 03, 2016, 03:47:56 pm »

How many developers does it take to turn the lights on?

Turns out the interweb has collected answers for that!

Logged
JRiver CEO Elect

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72538
  • Where did I put my teeth?
Re: How Many Developers Does It Take?
« Reply #4 on: March 03, 2016, 04:52:39 pm »

This one made me really laugh:

Q: How many Apple Newtons does it take to change a light bulb?

A: Foux! There to eat lemons, axe gravy soup.
Logged

jmone

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 14497
  • I won! I won!
Re: How Many Developers Does It Take?
« Reply #5 on: March 04, 2016, 02:50:08 pm »

I've also got the first of my Rachio Iro 2 smart irrigation controllers up and going. 
Logged
JRiver CEO Elect

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72538
  • Where did I put my teeth?
Re: How Many Developers Does It Take?
« Reply #6 on: March 04, 2016, 06:18:27 pm »

I've been looking at those.  Let us know what you think about them.
Logged

DarkPenguin

  • Citizen of the Universe
  • *****
  • Posts: 1921
Re: How Many Developers Does It Take?
« Reply #7 on: March 04, 2016, 06:48:06 pm »

Marshall!
Logged

jmone

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 14497
  • I won! I won!
Re: How Many Developers Does It Take?
« Reply #8 on: March 05, 2016, 01:16:12 am »

I've been looking at those.  Let us know what you think about them.

Here is a review I posted on their Forum but it was mainly focused on using a "US Centric" device in Oz.  I'm impressed enough to have now ordered a 2nd one, as my 1st (trial) went in fine.  Overall it is great being able to turn these zones on/off etc from a web browser or your phone (the traditional controlers were a pain to get to and do something as simple as run for 30 mins etc).  I'm trying their "smart" scheduling where you select a bunch of variables for your Zone (vegetation, soil, shade, slope, size etc) and it then uses data it pulls from your local weather station to work out when, and how long to water for.  Sounds great but the proof will be in how green stuff stays!
Logged
JRiver CEO Elect

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72538
  • Where did I put my teeth?
Re: How Many Developers Does It Take?
« Reply #9 on: March 05, 2016, 07:01:21 am »

Sound good so far.  Thanks.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72538
  • Where did I put my teeth?
Re: How Many Developers Does It Take?
« Reply #10 on: March 05, 2016, 03:40:42 pm »

The power strip is from Aeon:

http://aeotec.com/z-wave-power-strip

http://www.amazon.com/Aeon-Labs-DSC11-ZWUS-White-AL001/dp/B00H3RL6JW

It has six outlets.  Four of them can be controlled with Z-Wave.

Here is the USB Z-Wave dongle, also from Aeon:

http://www.amazon.com/gp/product/B00X0AWA6E

 
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72538
  • Where did I put my teeth?
Re: How Many Developers Does It Take?
« Reply #11 on: March 25, 2016, 06:39:36 pm »

We're getting to another milestone with this work.  John and Gene have been working to get the work packaged in a way we can share it.  We're close.  Close enough that I got it going at home today.

It's like the old DOS days.  One black screen is a server.  One black screen is a client.

The server talks to Z-Wave devices.  At this point, the client is a terminal window.  We're planning to go a little farther with that.

Run the server, which reads a config file, which can contain custom commands.

Run the terminal and tell the server what you want.

Add a Z-wave node:
add_node(dr,"any") to put it in a pairing mode.

add_node(dr,"stop") to end the pairing mode.

My only Z-wave device, at this time, is the Aeon power strip (see the last post).  Mine has six outlets.  Four are controllable with Z-wave.  Two are always on.

Turn a node on:
bset(2,100)  (the 2 is the node or device, the 100 is the % on)

Turn it off:
bset(2,0)   (node 2 is 0% on)

In the case of the power strip, there is another paramater, the index.  The index represents on of the four controllable power outlets.

bset(2,100,2) turns on the 2nd outlet...or maybe the 1st... I was a little confused by this.

bset(2,0,2) turns it off.

You can turn on all four or turn off all four in a sequence by using:

for i in range(5):bset(2,100,i)  turns all four outlets on

for i in range(5):bset(2,0,i) turns all four outlets off

or something like that...

Anyway, lights went on and off and it was embarassingly satisfying.

The next step is to build a proper API for the server, so that anyone can turn the lights on and off.

The question we're thinking about now, and with which we could use your help is; what kind of interface should it be?  I'd like to do 2 or 3 so that people can find what they need.

We have a web services interface for MC and I think it's been immensely successful.  If a developer can't find the right handle to pull, we can add it.  A lot has been built on it.  We could do something like it, maybe use similar commands.

We could use a simple URL to make the server respond.  We've built a way to do this in the OneRemote phone app, so it's logical to add support for it in the server.

And so on.  
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72538
  • Where did I put my teeth?
Re: How Many Developers Does It Take?
« Reply #12 on: March 27, 2016, 01:26:16 pm »

Moving on to the next device, an Aeon Labs outlet.  It's a Smartswitch 6, model ZW096-A02 .

add_node(dr,"any")

Press button on outlet to put it in pairing mode.

It was added as node 3.

add_node(dr,"stop")  to end pairing mode

bset(3,100) turned on the lamp that was plugged into the outlet

bset(3,0) turned the lamp off.

------

I had trouble with this yesterday, but today I tried resetting the outlet by holding the button down for about 30 seconds.  I believe this outlet had previously been paired with a SmartThings hub, and that this was preventing it from pairing with the Z-Stick.

Logged

jmone

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 14497
  • I won! I won!
Re: How Many Developers Does It Take?
« Reply #13 on: March 28, 2016, 01:25:55 am »

Have you looked at the Wemo devices yet?  They are UPNP devices so are discoverable, controllable and you can get their status over your local network.
Logged
JRiver CEO Elect

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72538
  • Where did I put my teeth?
Re: How Many Developers Does It Take?
« Reply #14 on: March 28, 2016, 06:48:53 am »

I did.  I didn't have a lot of luck.  I think I wrote a little about it.  They aren't Z-Wave devices, as far as I know.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72538
  • Where did I put my teeth?
Re: How Many Developers Does It Take?
« Reply #15 on: March 28, 2016, 12:20:27 pm »

Logged

jmone

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 14497
  • I won! I won!
Re: How Many Developers Does It Take?
« Reply #16 on: April 10, 2016, 08:20:06 pm »

FYI, if it helps on the Wemo - I have my little script being able to check what current Wemo Status is (On, Off, Disconnected) and then Turn it On and Off using Soap calls on the local Network.  I can not at this stage work out how to "Discover" the device on the network so have to code in the devices IP Address, Port and MAC Address.  Anyway, here is the code snipit. 
Code: [Select]
GetStatus:
  Wemo_Call = http://%WEMO_IP%:%WEMO_Port%/upnp/control/basicevent1
  WinHTTP := ComObjCreate("Microsoft.XMLHTTP")
  ComObjError(false)
  WinHTTP.Open("GET", Wemo_Call, False)
  WinHTTP.SetRequestHeader("Content-Type", "text/xml;charset=utf-8")
  WinHTTP.SetRequestHeader("SoapAction", """urn:Belkin:service:basicevent:1#GetBinaryState""")
  Body := "<?xml version=""1.0"" encoding=""utf-8""?><s:Envelope xmlns:s=""http://schemas.xmlsoap.org/soap/envelope/"" s:encodingStyle=""http://schemas.xmlsoap.org/soap/encoding/""><s:Body><u:GetBinaryState xmlns:u=""urn:Belkin:service:basicevent:1""><BinaryState>1</BinaryState></u:GetBinaryState></s:Body></s:Envelope>"
  WinHTTP.Send(Body)

  Result := WinHTTP.ResponseText
  Status := WinHTTP.Status
  RegExMatch(Result,"(?<=<BinaryState>)(.*)(?=</BinaryState>)", Wemo_Status)

  If Wemo_Status =
    Wemo_Status := "Not Found"
  If Wemo_Status = 0
    Wemo_Status := "Off"
  If Wemo_Status = 8
    Wemo_Status := "On"
Return

TurnOn:
  Wemo_Call = http://%WEMO_IP%:%WEMO_Port%/upnp/control/basicevent1
  WinHTTP := ComObjCreate("Microsoft.XMLHTTP")
  ComObjError(false)
  WinHTTP.Open("GET", Wemo_Call, False)
  WinHTTP.SetRequestHeader("Content-Type", "text/xml;charset=utf-8")
  WinHTTP.SetRequestHeader("SoapAction", """urn:Belkin:service:basicevent:1#SetBinaryState""")
  Body := "<?xml version=""1.0"" encoding=""utf-8""?><s:Envelope xmlns:s=""http://schemas.xmlsoap.org/soap/envelope/"" s:encodingStyle=""http://schemas.xmlsoap.org/soap/encoding/""><s:Body><u:SetBinaryState xmlns:u=""urn:Belkin:service:basicevent:1""><BinaryState>1</BinaryState></u:SetBinaryState></s:Body></s:Envelope>"
  WinHTTP.Send(Body)

  Result := WinHTTP.ResponseText
  Status := WinHTTP.Status
  Wemo_Status := "Turning On"
Return

TurnOff:
  Wemo_Call = http://%WEMO_IP%:%WEMO_Port%/upnp/control/basicevent1
  WinHTTP := ComObjCreate("Microsoft.XMLHTTP")
  ComObjError(false)
  WinHTTP.Open("GET", Wemo_Call, False)
  WinHTTP.SetRequestHeader("Content-Type", "text/xml;charset=utf-8")
  WinHTTP.SetRequestHeader("SoapAction", """urn:Belkin:service:basicevent:1#SetBinaryState""")
  Body := "<?xml version=""1.0"" encoding=""utf-8""?><s:Envelope xmlns:s=""http://schemas.xmlsoap.org/soap/envelope/"" s:encodingStyle=""http://schemas.xmlsoap.org/soap/encoding/""><s:Body><u:SetBinaryState xmlns:u=""urn:Belkin:service:basicevent:1""><BinaryState>0</BinaryState></u:SetBinaryState></s:Body></s:Envelope>"
  WinHTTP.Send(Body)

  Result := WinHTTP.ResponseText
  Status := WinHTTP.Status
  Wemo_Status := "Turning Off"
Return
Logged
JRiver CEO Elect

jmone

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 14497
  • I won! I won!
Re: How Many Developers Does It Take?
« Reply #17 on: April 11, 2016, 05:45:41 am »

Still can't discover the Wemo devices using Com's DeviceFinder (but I find heaps of others..... some posts say it is a windows 10 issue - I've no problem seeing the devices using UPnP discovery apps on my phone so it could just be my poor understanding of how this works).  Anyway, as I know the MAC for these devices, my workaround is to:
- use ARP to get the IP address, then
- try to get a Status on the the 3 possible ports that others have seen these devices use (49153, 49154, 49155) - Note: Mine have always been on 49153

Also http://192.168.xxx.xxx:49153/setup.xml provides Device and Service info for these devices.
Logged
JRiver CEO Elect

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72538
  • Where did I put my teeth?
Re: How Many Developers Does It Take?
« Reply #18 on: April 14, 2016, 03:05:40 pm »

New build:
http://www.jriver.com/OneRemote/OneRemote_01.55.00.apk

Discovery of SSDP devices is working pretty well.  Use the Search button in the upper right corner.

Press to connect.

Press and hold to add as a button.
Logged

jmone

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 14497
  • I won! I won!
Re: How Many Developers Does It Take?
« Reply #19 on: April 14, 2016, 04:14:24 pm »

Mmmm I can't install this version.  It starts to install then just comes back with the very helpful "Can't Install" msg.  I did upgrade the phone to MM the other day.  Rest looks the same.
Logged
JRiver CEO Elect

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72538
  • Where did I put my teeth?
Re: How Many Developers Does It Take?
« Reply #20 on: April 15, 2016, 12:45:24 am »

Do your settings on the phone allow installation from unknown sources?
Logged

jmone

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 14497
  • I won! I won!
Re: How Many Developers Does It Take?
« Reply #21 on: April 15, 2016, 01:21:13 am »

It installed fine once I manually un-installed the "old" version.
Logged
JRiver CEO Elect

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72538
  • Where did I put my teeth?
Re: How Many Developers Does It Take?
« Reply #22 on: April 15, 2016, 01:45:56 am »

I don't think Wemo will work.   At this point a OneRemote search should find any MC devices.  

Then click on one to connect.

Or long clink to save as a button.

The Z-wave parts are in a separate program called Engen.  Coming soon.

You could think of Engen as a center or hub.  It corresponds to MC.  It has an API similar to MCWS.

OneRemote is a general purpose customizeable menu program.  The goal is to make it capable of setting up and controlling devices of all kinds.  The first stage is to do this with the Id and (possibly) with MC.
Logged

jmone

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 14497
  • I won! I won!
Re: How Many Developers Does It Take?
« Reply #23 on: April 15, 2016, 03:03:44 am »

FYI - It finds on my network,
- MC Instances
- Yami AVRs
- Windows 10 UPnP
- HD Home Run
Logged
JRiver CEO Elect

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72538
  • Where did I put my teeth?
Re: How Many Developers Does It Take?
« Reply #24 on: April 15, 2016, 03:55:54 am »

What happens if you click on them?  Do you get a Presentation Page?
Logged

jmone

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 14497
  • I won! I won!
Re: How Many Developers Does It Take?
« Reply #25 on: April 15, 2016, 06:16:33 am »

I get:
- MC: MC Web Browser
- Yami & HD Home Run: Connection Refused
- Sami TV: No Application Can Handle This Request error
- Win 10 PC: Loading Circle goes round forever (need to reboot the Phone)
Logged
JRiver CEO Elect

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72538
  • Where did I put my teeth?
Re: How Many Developers Does It Take?
« Reply #26 on: April 15, 2016, 10:08:46 am »

Thanks.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72538
  • Where did I put my teeth?
Re: How Many Developers Does It Take?
« Reply #27 on: April 27, 2016, 10:26:27 am »

We have the Engen server acting as a web server now, similar to what MC does in order to support MCWS.  A web browser can be used to control the server and the Z-Wave devices connected to it.

We have just succeeded in using the OneRemote phone app to turn on a light and turn it off, though we need to use two buttons to do that at this time.  OneRemote uses a browser to open a link that looks like this:

199.242.131.151:52110/alpha000/basic_set?node=8,value=100  (turns on light)

and this:

199.242.131.151:52110/alpha000/basic_set?node=8,value=0   (turns off light)

On the web server end, it is talking to our Engen Z-Wave server running on Windows.  The Z-Wave server talks to a Z-Stick, a USB stick that transmits radio waves.  The lights are plugged into Z-Wave outlets that receive the radio signals.

The Engen server also runs on Linux and OSX.
Logged

imugli

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1598
Re: How Many Developers Does It Take?
« Reply #28 on: April 28, 2016, 06:03:09 pm »

I'm sure you know this, but you can use 2 jquery functions to

On first click -
- post the "On" url
- change the button class to a second one

then, on second click -

- post the "Off" url
- change the button class back to first one

Just bind the "On" click function to the first class, and the "Off" function to the second class.

And if (when) you want to get fancy, you could use a slider bar, bind the value of the slider to a variable and use that as your % in a change function. You have a dimmer.

Great work, by the way. HA with Z-Wave is something I'd love to get into, but it's always seemed a bit too hard. This sounds like it'll make things far easier.

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72538
  • Where did I put my teeth?
Re: How Many Developers Does It Take?
« Reply #29 on: April 28, 2016, 07:20:18 pm »

Thanks for all of that.  It may be useful.  I agree about the dimmer.
Logged
Pages: [1]   Go Up