Well I have a basic script for this working now…it is not fully integrated, but provides basic sensor input from the Multicast broadcast messages from the Network OWL.
The script as-is only supports the heating and hot water devices, but could be easily extended to cover solar PV (which I don’t have so are unable to test).
First of all a python script which captures the multicast messages and outputs as json:
import socket
import struct
import json
from xml.etree import ElementTree as ET
OWL_PORT = 22600
OWL_GROUP = "224.192.32.19"
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.bind((OWL_GROUP, OWL_PORT))
mreq = struct.pack("=4sl", socket.inet_aton(OWL_GROUP), socket.INADDR_ANY)
sock.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, mreq)
while True:
# Collect the XML multicast message
xml, addr = sock.recvfrom(1024)
# Parse the XML string
root = ET.fromstring(xml)
# Only process those messages we are interested in
if root.tag == 'hot_water' or root.tag == 'heating':
timestamp_value = 0
timestamp = root.find('timestamp')
if timestamp is not None:
timestamp_value = int(timestamp.text)
# iterate over each zone (Owl supports up to 4), but we don't distinguish
for zone in root.iter('zone'):
battery_value = 0
battery = zone.find('battery')
if battery is not None:
battery_value = int(battery.attrib["level"])
current_value = 0.0
current = zone.find('temperature/current')
if current is not None:
current_value = float(current.text)
required_value = 0.0
required = zone.find('temperature/required')
if required is not None:
required_value = float(required.text)
ambient_value = 0.0
ambient = zone.find('temperature/ambient')
if ambient is not None:
ambient_value = float(ambient.text)
print json.dumps({'device': root.tag, \
'timestamp': timestamp_value, \
'battery_level': battery_value, \
'current_temperature': current_value, \
'required_temperature': required_value, \
'ambient_temperature': ambient_value })
Then there is a bash script which takes the output of the above and publishes as MQTT messages with topic home/mcast/heating or home/mcast/hot_water.
#!/bin/sh
#
# owl_mcast2mqtt.sh
#
# Publish json output of the owl_mcast2json script to MQTT
#
export LANG=C
PATH="/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin"
MQTT_HOST="192.168.1.10"
MQTT_USER="homeassistant"
MQTT_PASS="SETPASSWORDHERE"
echo "OWL Network Multicast 2 MQTT"
python -u owl_mcast2json.py | while read line
do
MQTT_TOPIC="home/mcast/$(echo $line | jq --raw-output '.device')"
# Publish the json to the appropriate topic
echo $line | mosquitto_pub -h $MQTT_HOST -u $MQTT_USER -P $MQTT_PASS -i OWL_MCast -r -l -t $MQTT_TOPIC
done
Finally a sensor in configuration.yaml to pickup the values, e.g.:
Maybe this is for the “Share your Projects!” category, anyway I have an OWL Intuition Power Meter in my house and I implemented a custom sensor in Home Assistant:
I’m not using the UDP multicast, but rather the “push data” option from OWL. The sensor binds to a UDP port and then parses the received XML payload. Of course I only extracted the power meter data, but I guess this is easily extendable to other OWL devices (though I could not find any official documentation of the XML format - I just reverse engineered it).
One unresolved issue is that right now the sensor updates its state synchronously, which is not nice because it listens for UDP notifications that “only” come every minute, and plenty of warnings are (legitimately!) logged by HA. I’d like to make the implementation asynchronous: is there any guideline/documentation to implement async updates?
Once I resolve this I’ll consider contributing it via PR, but for now it can already be used.
Configuration example:
sensor:
- platform: owlintuition
port: 3200
mode: triphase # default is monophase
monitored_conditions:
- battery
- radio
- power
- energy_today
I also created a templated sensor to group together the three phases:
sensor:
- platform: template
sensors:
owl_meter_triphasepower:
friendly_name: OWL Meter Triphase Power
icon_template: mdi:flash
value_template: "{{ states.sensor.owl_meter_power_P1.state }} W + {{ states.sensor.owl_meter_power_P2.state }} W + {{ states.sensor.owl_meter_power_P3.state }} W"
Im kinda of new to the home Assistant community , and i can say im loving it.
I to have a owl intuition and running Hass.io and i can no for the love of god get them to work together.
Ive looked at your GitHub, and currently using your script (nice job btw). but im stuck.
Well here are my steps
-Ive gone to the owl intuition an pointed the push data UDP to my hass.io IP
-Installed your script in the config folder custom_components/sensor
-created the sensor and the group.
all apeares in the dashboard but as unknown.
and if i go to the logs i get these errors
2018-04-13 12:30:24 ERROR (SyncWorker_8) [custom_components.sensor.owlintuition] Unable to bind on port 3200: [Errno -2] Name does not resolve
2018-04-13 12:31:26 ERROR (SyncWorker_17) [custom_components.sensor.owlintuition] Unable to bind on port 3200: [Errno -2] Name does not resolve
2018-04-13 12:32:28 ERROR (SyncWorker_10) [custom_components.sensor.owlintuition] Unable to bind on port 3200: [Errno -2] Name does not resolve
2018-04-13 12:33:30 ERROR (SyncWorker_12) [custom_components.sensor.owlintuition] Unable to bind on port 3200: [Errno -2] Name does not resolve
2018-04-13 12:34:32 ERROR (SyncWorker_7) [custom_components.sensor.owlintuition] Unable to bind on port 3200: [Errno -2] Name does not resolve
what could i be missing, I’ve bean at it a few day and cannot figure it out.
The 'Name does not resolve' error suggests that from your hass.io you cannot resolve hostnames, but then I don’t understand how it can connect to other components: do you have other working sensors?
Anyway to further troubleshoot your setup, can you get a shell inside hass.io? (I don’t know the details of that, I personally use homeassistant inside a docker container)
If yes, try to launch python and then execute the following:
I expect the getfqdn() to fail, but maybe gethostname() works and the OWL sensor could be adapted to use that. Also, you might hardcode the IP address of your hass.io (but I’d make it a configuration parameter - I can’t do this modification now but may work on that).
I’m new to HA and have an Owl Intuition can anyone please help me get this working?
I’ve added the following to my configuration.yaml file:
> - platform: owlintuition
> port: 3200
> mode: monophase # default is monophase
> monitored_conditions:
> - battery
> - radio
> - power
> - energy_today
I created a folder under my config folder called “customer_components\sensor” and copied the script from github to a file called owlintuition.py and placed it in the sensor folder.
I’m not sure what I need to do in the push data settings in the owl in the web interface, am I just pointing it at the internal IP of the HA instance?
When I add the above owl sensor to my configuration.yaml file and then check config it gets stuck and won’t validate the config or restart until I delete the sensor owl sensor from HA.
No I gave up on it and couldn’t get it to work, thanks for replying!
I’ll give your config a go and reply back. Besides the config above I’ve put the owlintuition.py file in config\custom_components\sensor folder do I need to do anything on the owl device?
Sorry for having missed your first post, anyway a priori what you did is all correct (including the push settings in the OWL web interface). What do you see in the HA logs?
And finally, note that a recent update of the OWL firmware broke the XML format (but they should be deploying the fix, I got it after asking their support).
It’s working now I just had to put the Host IP Address in configuration.yaml file. Thank you both for your help.
One more question, can I get this to show What my solar system is currently generating and total generation for today? How often does the data get refreshed?
For your questions: the data is refreshed every minute, and about your solar system, of course I can’t say. But if you have another current clamp on its output you should be able to get your data. You can play with my demo above to look at the full XML data and check what you have.
Hi, to add to the above: I realized that OWL explicitly supports solar panel systems.
If you send me the XML you get e.g. by running my demo, I can try and integrate a sensor for the solar panel.
Simply run the script (python owlintuition.py) from the same box where you run HomeAssistant - stop HA if you wish to use the same port. Within a minute it will print the XML packet received from the OWL base station.
Yeah sorry no idea how to run it, I know nothing about python or how to run the script. I installed python on my windows desktop and pointed the push data settings on my owl to my windows desktop and run it but still not sure what I’m doing.
Nope. I got the solar generators supported thanks to @bcowell, but at that time my several attempts at getting the async way working failed both for me and for him - we had Home Assistant randomly crashing every couple of hours.
If you want to have a look at the last version, it’s here:
But despite not producing any error and working fine for some time, it crashes HA.
Thanks for the update, I’ve been playing with my setup and have discovered a number of idiosyncrasies with the OWL system that I thought worth mentioning in case it helps anyone else. I have two Network OWLs running at two different properties so have been able to identify a range of issues.
First of all the older generation of hardware used a fixed IP address for firmware updates. The company no longer controls that IP address and therefore the older hardware cannot be updated unless it received an interim firmware update while they still controlled the IP address.
The older generation hardware has a MAC address beginning ‘4337190’ and the newer generation MAC ID should start ‘4437191’. There is still stock on shelves with some retailers that is the old hardware so if buying a new device get them to check the MAC address before purchasing.
The older generation hardware latest firmware is 2.8:1096 whereas the new generation is at 4.3:608 and the XML that is transmitted is slightly different!