Getting Owl 160 on the Energy Dashboard from MQTT

I have an OWL CM160 Energy Monitor and for years have been using Eagle-Owl to monitor my household energy consumption using the USB connection.

However the display unit has been getting increasingly unreliable and stops reading from the transmitter all the time, so I’d like to stop using it.

However rtl_433 picks up the messages sent from transmitter and puts them into my MQTT server just fine.

A typical payload to rtl_433/Oregon-CM160/8 looks like the following

{"time" : "2022-04-27 15:51:38", "brand" : "OS", "model" : "Oregon-CM160", "id" : 8, "power_W" : 676}

My understanding is that the power_W is the current draw, and this payload is only updated on significant changes & once a minute - therefore you can assume (like it’s display unit did) that 676w is being drawn from now until the next message.

However by adding a new MQTT sensor to homeassistant/sensor/rtl433/Home_temperature_c/config with the payload:-

{"device":{"name":"OWL Energy Monitoring - Home","identifiers":["home"],"manufacturer":"RTL 433","model":"Aitken"},"name":"Home - Power Consumption (W)","unique_id":"rtl433_Home_temperature_c","state_topic":"rtl_433\/Oregon-CM160\/8","json_attributes_topic":"rtl_433\/Oregon-CM160\/8","value_template":"{{ value_json.power_W }}","unit_of_measurement":"W","state_class":"measurement","device_class":"energy"}

This is then added to the sensor like so and shows up fine in Home Assistant

It doesn’t show up on the energy dashboard as an option.

Searching around it seems that some form of value needs to be added to last_updated (where - guessing the config?) but this isn’t something I know.

Is it possible for these to be read into the energy dashboard in any way?

you need to add the following to your sensor description in the configuration.yaml

device_class: energy

Hey, you may want to integrate directly with USB port to CM160, I’ve built an integration for this: GitHub - PBrunot/energy_owl_hacs: A custom integration for Home Assistant to push realtime current consumption from Energy OWL CM160 devices connected on USB port

1 Like

Looks interesting - however I can’t get it to work.

Over the Christmas period my old PC that has been running the eagle-owl code for years finally gave up the ghost (annoyingly this Owl feed was the last thing I had left to move) so am now looking at trying to get this integration working (note, if you find your CM160 is playing up and losing connection to the CT clamps - use anything other than brand new Duracell batteries in the display)

I’ve also moved my Home Assistant install from a Raspberry Pi 4 to an N100 Mini PC running Proxmox (why did I never do this before - so much faster?) so am now having to deal with getting the USB port passthrough working. Alas I get the following error message when I enable Debug logging.

This error originated from a custom integration.

Logger: owlsensor.serial_cm
Source: custom_components/energy_owl/sensor.py:38
integration: Energy Owl CM160 Serial port integration (documentation, issues)
First occurred: 15:38:42 (1 occurrences)
Last logged: 15:38:42

Connect: [Errno 11] Could not exclusively lock port /dev/ttyUSB0: [Errno 11] Resource temporarily unavailable

/dev/ttyUSB0 only showed up after I shared the USB device with the VM running Home Assistant OS.

The usual “force the permissions” trick obviously doesn’t work with Home Assistant OS.

[core-ssh ~]$ chmod 777 /dev/ttyUSB0*
chmod: /dev/ttyUSB0: Read-only file system

The hardware config in Proxmox is as follows:

Any ideas of additional things I can look at?

Also, Presumably the Instantaneous Power Template would look something like the following (assuming an average volatage of 232V):-

{{ (iif(states(“sensor.cm160_current”)==‘unknown’,0,states(“sensor.cm160_current”)) * 232)|float / 1000 }}