Owl CM160 Energy Monitor

1,152 views
Skip to first unread message

Ben Jones

unread,
Jun 11, 2013, 7:20:30 AM6/11/13
to ope...@googlegroups.com
Hey team,

Just finished a small script which enables an interface between the Owl +USB energy monitor and openHAB (via the REST API). This device (CM160) has very poor support on Linux and the software supplied with the device is apparently pretty awful (I haven't tried it myself). 

I came across eagle-owl by Philippe Cornet which provided libraries for talking directly to the CM160 rather than trying to use the CP210X driver.

I have simplified this a bit and added some code to enable posting energy values back to openHAB using the REST API.

Attached is the source and a compiled version of the program (for i386).

I have this running on my Ubuntu 12.04 server with the CM160 plugged in (via USB) and it is happily posting updates back to my openHAB instance at regular intervals.

Not sure if this is of any use to anyone else, but thought I would put it on here just in case. 

I actually wrote a proper openHAB binding to talk to the CM160 but this relied on the USB drivers which are not working on Linux (the binding worked just fine on a Windows machine). I could upload this to my clone at some point if anyone wants to run this on a Windows PC?

Anyway - any questions fire away.

Cheers,
Ben
morpork.zip

Frederico

unread,
Jun 12, 2013, 5:19:39 AM6/12/13
to ope...@googlegroups.com
Hi!

Any chance you have a windows version lying around? :-)
If not I'll try to port your code - I am currently accessing owl data from its mysql database but it's not real time (~20/30 seconds delay).

Thks.

Regards,
   Frederico

Ben Jones

unread,
Jun 12, 2013, 5:31:19 AM6/12/13
to ope...@googlegroups.com
Sorry Frederico, I don't. The source is there tho, could you try compiling yourself? The other alternative is to try my Owl openHab binding (in my clone). That works nicely on Windows and provides real time monitoring of the Owl data feed. I would rather be using this if I could but can't due to the lack of suitable drivers on Linux.
--
You received this message because you are subscribed to a topic in the Google Groups "openhab" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openhab/G4_yariNZRk/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Frederico

unread,
Jun 12, 2013, 5:36:45 AM6/12/13
to ope...@googlegroups.com
Cool, I will be looking at your binding first then!
Thanks :)
To unsubscribe from this group and all its topics, send an email to openhab+unsubscribe@googlegroups.com.

Frederico

unread,
Jun 16, 2013, 4:37:44 PM6/16/13
to ope...@googlegroups.com
Hi!

Unfortunately I still do not have a working environment to build openhab & bindings (I am a .net kind of guy :) ).
I tried to write an adapter in c# but the owl driver seems to get stuck after a while (I guess I am supposed to answer to some of the frames received from it).

Can you please point me at a jar file for the binding?

Thanks!

Best regards,
    Frederico


On Wednesday, June 12, 2013 10:31:19 AM UTC+1, Ben Jones wrote:
To unsubscribe from this group and all its topics, send an email to openhab+unsubscribe@googlegroups.com.

Ben Jones

unread,
Jun 16, 2013, 4:54:18 PM6/16/13
to ope...@googlegroups.com

Hey – here is the compiled binding. Good luck!

To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.


To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--

You received this message because you are subscribed to a topic in the Google Groups "openhab" group.

To unsubscribe from this topic, visit https://groups.google.com/d/topic/openhab/G4_yariNZRk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.


To post to this group, send email to ope...@googlegroups.com.

org.openhab.binding.owl-1.3.0-SNAPSHOT.zip

karsten.k...@gmail.com

unread,
Aug 7, 2014, 8:48:46 AM8/7/14
to ope...@googlegroups.com
Hi Ben

did this ever went into standard bindings? i looked into current Wiki and was not finding the same.

I am currently thinking of buying the OWL +USB and integrate the same to Openhab for energy metering. Mainly i want to count the engery being created from my solar panels. 

I currently have OH running on a PI with version 1.4

thanks
Karsten


Ben Jones

unread,
Aug 7, 2014, 1:15:55 PM8/7/14
to ope...@googlegroups.com

Nope, since it didn't work on Linux I didn't think it was worth adding. In the end I bought an RFXCOM transceiver and used that to listen for energy readings and imported into openHAB via the RFXCOM binding.

I am about to retire the Owl however as I came across the Open Energy Monitor project. Check it out before you buy an Owl, you can do a lot more for relatively cheap. But it requires a bit more tinkering...

Matthieu Spriet

unread,
Mar 4, 2015, 2:09:49 AM3/4/15
to ope...@googlegroups.com
Hello,

I don't find you're clone with the source of the OWL binding.
Could you give me the url please.

Thanks.

Neil Renaud

unread,
Mar 4, 2015, 4:35:25 AM3/4/15
to ope...@googlegroups.com
Hey Ben,

How did you convert the numbers that owl sends over 433? The numbers don't seem to line up with what the Owl display shows.

Neil

Ben Jones

unread,
Mar 4, 2015, 4:45:24 AM3/4/15
to ope...@googlegroups.com
All the code is in the zip in the original post. There is no repository online sorry.

Neil, it was that long ago that I have no idea how it used to work sorry! Have a look at the code if you like.

I am now using an EmonTX from Open Energy Monitor so have looking since retired the Owl.

Neil Renaud

unread,
Mar 4, 2015, 4:52:56 AM3/4/15
to ope...@googlegroups.com

Thanks Ben will do. How are you powering the sensor? Ironically the one place that I don't have a plug socket is by the external electricity meter...

From a quick glance it isn't obvious that the sensors can be battery powered...

--
You received this message because you are subscribed to a topic in the Google Groups "openhab" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openhab/G4_yariNZRk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.

Ben Jones

unread,
Mar 4, 2015, 4:56:01 AM3/4/15
to ope...@googlegroups.com

I am powering it using POE. I have the EmonTX Arduino shield on an Arduino + ethernet clone. But I did get a power socket installed when I had my solar panels installed as ideally you need an AC voltage reference to get the most accurate power readings.

Max Lock

unread,
Mar 4, 2015, 5:08:21 AM3/4/15
to ope...@googlegroups.com

Hi Matthieu,

Fyi I'm using the cm160server.py code that's included with electricowl
http://sourceforge.net/projects/electricowl/

It returns the current power usage to clients connected to a tcp port.
like this

items:

String Power "Power [%s]" <energy> (power)
{ tcp=">[172.31.255.2:12745:'REGEX((.*))']" }
Number Power_current "Amps [%.2f A]" <energy> (power,persist)

rules:

rule "get current power usage"
when
Time cron "0 * * * * ?" or
then
sendCommand(Power, "GET")
end

rule "process power usage"
when
Item Power changed
then
var buffer = Power.state.toString.split(";")
if(buffer.get(0).contains("INFO")
&& !buffer.get(4).contains("255:255")){ postUpdate('Power_current',buffer.get(1))
}
end

This is far from ideal and I'd like to rewrite cm160server.py to
something leaner and friendlier. The other option is this
https://github.com/taiyoh/go-cm160 which looks pretty interesting

-Max

Matthieu Spriet

unread,
Mar 4, 2015, 6:29:37 AM3/4/15
to ope...@googlegroups.com
Hi everybody,

Thanks Max I wil try this solution.

Ben, could you publish in an attachement, the source code of the org.openhab.binding.owl-1.3.0 (with the *.java files) ? I try to code a binding, but if you have do the job, it is better for me :-)

Thanks

Ben Jones

unread,
Mar 4, 2015, 2:28:30 PM3/4/15
to ope...@googlegroups.com
Here is a link to the source;


Sorry but I don't currently have a dev environment setup for building anything - new PC and having real trouble getting openHAB to compile.

Matthieu Spriet

unread,
Mar 5, 2015, 3:35:56 AM3/5/15
to ope...@googlegroups.com
Thanks a lot and good job. This is what I need.
Reply all
Reply to author
Forward
0 new messages