Decoding the OWL Intuition XML scheme for electricity monitoring

Got some more info in these exceptions after an openhab2 update.

org.openhab.core.transform.TransformationException: transformation throws exceptions
        at org.openhab.core.transform.TransformationHelper$TransformationServiceDelegate.transform(TransformationHelper.java:62)[194:org.openhab.core.compat1x:2.1.0]
        at org.openhab.binding.tcp.protocol.internal.UDPBinding.transformResponse(UDPBinding.java:263)[193:org.openhab.binding.tcp:1.10.0]
        at org.openhab.binding.tcp.protocol.internal.UDPBinding.parseBuffer(UDPBinding.java:159)[193:org.openhab.binding.tcp:1.10.0]
        at org.openhab.binding.tcp.AbstractDatagramChannelBinding.parseChanneledBuffer(AbstractDatagramChannelBinding.java:1014)[193:org.openhab.binding.tcp:1.10.0]
        at org.openhab.binding.tcp.AbstractDatagramChannelBinding.execute(AbstractDatagramChannelBinding.java:1551)[193:org.openhab.binding.tcp:1.10.0]
        at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:157)[194:org.openhab.core.compat1x:2.1.0]
        at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:169)[194:org.openhab.core.compat1x:2.1.0]

Dont know if this throws any more light on it?

just to be on the safe side: do you have the xpath transform installed (it is not the same as xslt)?

with kind regards,
Patrik

Yes I do. I uninstalled and reinstalled using karafe as it armed to throw an error the first time. Certainly appears as active in karafe bundle list.

I still think it doesn’t like that syntax for accessing the attribute. Not all implementations of xpath handle attributes the same.

Hi mrichmond007,

did you manage to find a solution to this in the end? I have the same issue with my Owl intuition PV. I can read the udp packet and the string but when I try to extract an element it just returns the whole string whatever I do. works when I cut and paste into an online formatter so I think the syntax is correct.

interestingly, did remove all xpath code references and just left the udp:xxx.xxx.xxx.xxx address and still get the full string returned. out of ideas!

I didn’t get a solution within openHAB in the end. I did get something working with a python script that posted into the influx DB directly. I was going to have another go at this after my updates and a re-install. I am not filled with confidence now based on your experiences.

I did exactly the same as you and had the entire string return no matter what I did.

Will let you know if I get any further.

M.

Glad its not just me then, even though I must add am coming at this from a very low level of programming ability, you could say non existent. As I said, like you nothing I do changes the output. One thing I did notice is that when I intercept the udp packet using wireshark the xml tags in the string look incomplete. I have split it down and I get


 <solar id='4xxxxxxxxxx3'>
<timestamp>1506550723</timestamp>
 
 <current>
 <generating units='w'>0.00</generating>
 <exporting units='w'>0.00</exporting>
 </current>
 
 <day>
 <generated units='wh'>6364.61</generated>
 <exported units='wh'>2340.79</exported>
 </day>
 
 </solar>

I am probably wrong but to my untrained eye (from the examples I have read) it looks like the generating, exporting, generated and exported elements which I am trying to extract are all missing closing > where you would expect to see them. My hunch is that this means the xml is technically not formatted correctly and therefore invalid and this is preventing the xml string being read and transformed correctly by the XPATH commands perhaps.

1 Like

I’m finishing my binding for my weather station. Then I’ll work on this binding.

It should not be too difficult.

1 Like

Thanks Gabriel,

Getting nowhere with this sadly :frowning:

1 Like

Not sure if this is any help or not but I have taken a slightly different route. I have written a python script that receives the multicast messages. Using xmltodict it parses them and then I send them to openhab using mqtt. This is probably the long way round.

I have it working for current power, current solar, day power usage, day solar generation, current heating stats and water stats.

The next thing I need to figure out it how to start setting th heating controls.

1 Like

Hi, I put this down for a while, mainly as I was getting nowhere, but now the nights are getting darker I have got back on it, Still looking for a way of establishing the exporting reading from my Owl so I can hopefully create a rule to identify when I am exporting over a certain amount so it will then turn an electric heater so I put the free electricity to good use. Would be really Interested to understand how you have managed to use MQTT to generate values or if anyone else has managed to get any further with this?

1 Like

Hi, I bought the Sonoff Pow 2 and setup the tasmota firmware. (~12$).
It was easier than trying to adapt my owl device.

Thanks to Fernando Gomes I now have a working string that will return the solar values from the Owl via UDP

My items:

String owlTimeStamp   "TimeStamp [%s]"         <time>   (gOwl)  { udp="<[192.168.1.4:*:'REGEX(.*<timestamp>(.*)</timestamp>.*)']" }
String Generating  "Generating [%s w]"   <time>   (gOwl)  { udp="<[192.168.1.4:*:'REGEX(.*<generating units='w'>(.*)</generating>.*)']" }
String owlgenerated   "owlgenerated [%s kWh]"  <time>   (gOwl)  { udp="<[192.168.1.4:*:'REGEX(.*<generated units='wh'>(.*)</generated>.*)']" }
String Exporting   "Exporting [%s w]"    <time>   (gOwl)  { udp="<[192.168.1.4:*:'REGEX(.*<exporting units='w'>(.*)</exporting>.*)']" }
String owlcurrent "owlcurrent [%s w]" <time> (gOwl)  { udp="<[192.168.1.4:*:'REGEX(.*<chan id='2'><curr units='w'>(.*)</curr>.*)']" }

My Sitemap:

       Default item=Generating icon="solarplant"
       Default item=Exporting icon="solarplant"
       Default item=owlcurrent icon="solarplant"

Can’t get the current value to work but the others work a treat so may be of use to anyone trying to get values form their Owl,

Hope it helps someone and thanks again to Fernando :slight_smile:

1 Like

This is interesting. Did you ever figure out why the “current” value wasn’t working?
Did you have to setup Data push on the settings, or does this method rely on the multicast? The IP you are specifying in the IP address of the network monitor, correct?

Cheers!

Hi, no sadly never got the current working and the guy who helped me never can back to me.

It relies on multicast but you need to go onto the owl website and configure the IP address and port as far as I can remember. I think this then downloads to the network monitor to enable UDP broadcast on that port and address you configure. The IP address in the code is indeed the internal IP of the network monitor which has a reservation set on the router to ensure it doesn’t change on reboot.

Works perfectly both locally and externally on the openHAB app

Let me know if you need any additional info

Chris

1 Like

Many thanks for your reply.

I still have no luck getting any numbers back.
I’ve tried configuring the data push on the OWL with it’s own IP, with the openhab server’s IP. I’ve tried setting these different IP’s and ports on the items, but nothing so far.

Can you share you configuration in further detail? your tcp binding configuration? The owl’s?

The only result I get is using the sample app OWL has on their site, intuition-listener.c, which relies on the multicast address 224.192.32.19 and port 22600, nothing needs to be configured on the data push option, so any device can subscribe and listen, which I like, but getting that into OH will also be a challenge.

Just in case this is of any interest to anyone, in the end I used a different approach, that doesn’t require any configuration on the OWL website, and it works perfect for me, I shared it here:

Hi Jose, I had a think and had a look at my config and remembered you need to install the tcp\udp binding and set the listen port in the udp.cfg file (copy of the tcp.cfg file renamed from memory). think that was everything. However, looks like you have a better solution I will have a look at. will let you know how i get on

1 Like

Thanks Chris,

I tried all that, different configurations, ports, tinkered around with the tcp binding config, but never got it to work. Since I knew, from the C code example I had previously downloaded from their site, that I could get the info through multicast, I went that route instead and it worked great for me.
Specially because I have another OWL installed in a friend’s house, but his OpenHAB is behind another router in the network, but with multicast it works like a treat, without any port redirection or OWL configuration.

Hi,

Here is the link to configure the owl using the tcp/udp binding:

Best Regards,
Fernando Gomes