Scripting question for OWServer...

Posted on
Mon Mar 25, 2019 10:10 am
russg offline
Posts: 46
Joined: Oct 02, 2014

Scripting question for OWServer...

I've been using the OWServer Plugin for quite awhile and really appreciate it. Thanks for the hard work!

I am having trouble with what should be a basic scripting task, and I'm hoping someone can help. I'm new at this, please don't laugh.

I have an OWServer with 16 temperature sensors on the chain. I have a case where I need to monitor 2 temps and generate an alert if they get within 5F of each other. My problem is, how do I reference the individual temperatures from Python?

Any input appreciated!

Posted on
Mon Mar 25, 2019 4:10 pm
DaveL17 offline
User avatar
Posts: 6744
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Scripting question for OWServer...

Glad to hear that you're finding the plugin useful. You didn't specify what kind of temperature sensor, but this should work for most applications. It assumes a DS18B20 device type.

Code: Select all
dev_1 = indigo.devices[1397166285]  # replace with the id of your first device
dev_2 = indigo.devices[926302007]  # replace with the id of your second device

dev_1_temp = dev_1.sensorValue
dev_2_temp = dev_2.sensorValue

diff = abs(dev_1_temp - dev_2_temp)

if diff >= 5:
    #do stuff

We were all new once, so no laughing here.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Mon Mar 25, 2019 6:29 pm
russg offline
Posts: 46
Joined: Oct 02, 2014

Re: Scripting question for OWServer...

Thanks Dave, I was doing something silly.

Just wanted to say thanks again for your support on this plugin. Adding all the device types is a lot of work and keeping up with the FW changes has to stink. I don't think people grasp the value of this yet. Granted, you have to be able to drop a line between sensors, but if you can do that and are comfortable around a soldering iron, you can add sensors for just a couple of dollars.

I only use it for temperature sensors right now, but will be adding a second OWServer and a long trenched run outside (pushing the 1000' mark with several devices) later this year. There is no way I could justify the expense of doing this with Insteon (or other) discrete devices. With this, it's amazingly easy.

I'm going to have to see if I can write a protocol analyzer for my scope some time soon, I suppose.

Thanks again for the help and support!
-russ

Posted on
Mon Mar 25, 2019 8:05 pm
DaveL17 offline
User avatar
Posts: 6744
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Scripting question for OWServer...

russg wrote:
Thanks again for the help and support!
-russ


You bet. Glad to know that there's another using the plugin. I think this is one is less widely used than some of my others--but it's also one that I use--so it will live on!

In fact, there is an OWServer 2.0 (or something like that) in the workshop now which takes a new tack at the different supported devices. Take, for example, an EDS0068 with optional relay. The current plugin tries to incorporate all the features of that model in one Indigo device. Under the new paradigm, each feature will be its own device type. So for one EDS0068, you would have one Indigo device for temperature, a second for humidity, etc. I think the killer feature, though, is that it will handle the relay as an Indigo switch type. You'll be able to turn it on and off just like a light switch. Same with the LED.. This will allow for better use of native Indigo hooks and logic. For example, if a humidity level goes above a certain threshold, fire the relay to turn on a fan. At least that's the plan, anyway. :D

Screen Shot 2019-03-25 at 8.48.37 PM.png
Screen Shot 2019-03-25 at 8.48.37 PM.png (115.32 KiB) Viewed 3531 times


Screen Shot 2019-03-25 at 8.49.19 PM.png
Screen Shot 2019-03-25 at 8.49.19 PM.png (123.94 KiB) Viewed 3531 times


It will (of course) still support the DS18B20. I agree that these are a crazy good value. After you drop US$100 on a server, you can add sensors for $2.00 each (or less), plus the cost of wire and a little elbow grease. At 10 sensors, that's a marginal cost of $12 each. At 20 sensors, the marginal cost is $7 each. (IIRC, the max number of sensors is 24 which would be about $6.20 each.) They're cheap, fast, and don't require batteries!

I also have plans for the next major version to include support for the new EDS Meshnet controller and Meshnet devices, too. I'm trying to squeeze development into the bits of free time I have when I'm not working on one of my other plugins.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Wed Mar 27, 2019 12:50 am
russg offline
Posts: 46
Joined: Oct 02, 2014

Re: Scripting question for OWServer...

Oh, yeah, that is sweet! I can see some upcoming projects where that would be super useful! If I have the devices required and you ever need a beta tester, drop. me a shout.

Have you ever seen the CURB Energy Monitor? (https://energycurb.com/shop/curb-lite/). It monitors and records current data for 14 circuits in your breaker box and saves it for.a year.. I've had one running for 2 years with no glitches or restarts and I love it. I used it to reduce energy costs (which paid for it in about 2 months). Now, I'd love to be able to create triggers using this (sump pump just turned on, humidifier is drawing too much current, etc.). If you ever decided to try writing a plug in for it, I'd be a huge fan. In fact, I might be willing to partially pay for a unit, should you become interested.

Just another way to bring critical data into Indigo at a very reasonable cost.

Enough trying to get someone to do something that I don't have the skills for (sigh). Have a good night.

thanks again!
-russg

Posted on
Wed Mar 27, 2019 6:01 am
DaveL17 offline
User avatar
Posts: 6744
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Scripting question for OWServer...

Interesting -- I've not looked at the CURB before.

I did a quick scan of the website and didn't see a formal API (that, of course, doesn't mean it doesn't have one.) Plugins aren't too tough to write with an XML or JSON API to hook into. Beyond that, it would require some kind of reverse engineering to get at the data which is more involved and can be less stable because there's no guarantee that the data will be delivered in a consistent way.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Thu Mar 28, 2019 10:32 pm
russg offline
Posts: 46
Joined: Oct 02, 2014

Re: Scripting question for OWServer...

Yes, they redesigned their website and the new one is pretty lame. Two years ago I was told that you could receive the data as an XML tree, but I don't know if that has changed.

They do have everything for 3rd party developers, including their API up on github at:
https://github.com/Curb-v2/third-party-app-integration

There is also a 3rd party bridge for SmartThings at:
https://github.com/Curb-v2

I'm struggling to ramp on Python, and this is just beyond me right now. The SmartThings Bridge might be useful, but I haven't mucked with SmartThings at all.

Let me know if you decide to poke at it.
thanks again!
-russg

Posted on
Fri Mar 29, 2019 5:39 am
DaveL17 offline
User avatar
Posts: 6744
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Scripting question for OWServer...

It looks like the API is available using OAuth 2.0, so you might be able to access the data using the GhostXML plugin. If you fancy a go, tor the Authentication setting, try 'Token' and see if that doesn't pull in the data for you.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Fri Mar 29, 2019 10:37 pm
russg offline
Posts: 46
Joined: Oct 02, 2014

Re: Scripting question for OWServer...

Hmmm... I'll got poke at it a bit, but as I don't even know what OAuth is, it could be problematic.

However, thanks for taking the time to look at this. If you ever decide to buy one, let me know :D

thanks - rush

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest