Hello, I have an owl cm180 energy monitor that I’ve setup with a rfxtrx433e. Every now and then I get a Total usage stat of 0 which is throwing off my calculations for cost for the previous hour. It doesn’t reflect on the owl monitor itself, only within home assistant. Has anybody else come across this? My gut feeling is that it’s the reading from one of the other phase inputs from the transmitter (I only have 1 connected) but I only see one input in home assistant.
The total use stat is also slightly off compared to what I see on the owl monitor, if anybody has any advice on that I’d appreciate it too!
Filter on the 7th byte which is the packet counter.
packet counter.
For subtype 0x02 = ELEC3 is CM180:
Count = 0 : packet contains instant and total power
Count > 0 : packet contains only instant power (ignore total power = 0)
That makes total sense, thanks! I had noticed the count field but couldn’t find any info about it.
I created a template sensor yesterday that only updated if total usage > 0, I might change that to count now I know what it does.
Can you share me your solution?
I was a user of Domoticz and the energy monitor was very simple (with some LUA script).
Since i’m on home assistant, i have some difficulties to implement a perfect energy monitor.
I have the same hardware: owl cm180 energy monitor with a rfxtrx433e.
I have done the integration and i have tried some solution:
- Direct use of ELEC3, CM180 83:62 Total usage (Cumulate KWh)
- Convert ELEC3, CM180 83:62 Energy usage in Kwh with plateform integration
The second solution is not the perfect one because i have some time some peak
Can you help me to have a good solution?
Anyone have a solution on this to share?
Not the same ‘fix’ but an option for others - is take the ‘watts’ reading and use the integration sensor, to then feed the utility_meter:
If you have a sensor that provides you with power readings in Watts (uses W as unit_of_measurement
), then you can use the integration
sensor to track how much energy is being spent. Take the next configuration as an example:
sensor:
- platform: integration
source: sensor.current_power
name: energy_spent
unit_prefix: k
round: 2
So add the below to the end of your ‘sensor’ configuration modifying as appropriate for your own OWL device:
- platform: integration
source: sensor.elec3_cm180_8b_22_energy_usage
name: electricity_energy_spent
unit_prefix: k
round: 2
Then:
utility_meter:
electricity_hourly_kwh:
source: sensor.electricity_energy_spent
cycle: hourly
electricity_daily_kwh:
source: sensor.electricity_energy_spent
cycle: daily
electricity_weekly_kwh:
source: sensor.electricity_energy_spent
cycle: weekly
electricity_monthly_kwh:
source: sensor.electricity_energy_spent
cycle: monthly
electricity_quarterly_kwh:
source: sensor.electricity_energy_spent
cycle: quarterly
electricity_yearly_kwh:
source: sensor.electricity_energy_spent
cycle: yearly
Define a script to easily reset your utility sensors:
utility_reset:
sequence:
- service: utility_meter.calibrate
data:
entity_id: sensor.electricity_hourly_kwh
value: 0
- service: utility_meter.calibrate
data:
entity_id: sensor.electricity_daily_kwh
value: 0
- service: utility_meter.calibrate
data:
entity_id: sensor.electricity_weekly_kwh
value: 0
- service: utility_meter.calibrate
data:
entity_id: sensor.electricity_monthly_kwh
value: 0
- service: utility_meter.calibrate
data:
entity_id: sensor.electricity_quarterly_kwh
value: 0
- service: utility_meter.calibrate
data:
entity_id: sensor.electricity_yearly_kwh
value: 0
Then call the ‘script.utlity_reset’ from Developer Tools.
So I think the below sets out to do what Mark discusses above - ignoring values of 0.
My CM180 died and/or stopped transmitting randomly, the newer CM180i that I have only shows amps/current and total usage in wh (no power in watts, like the CM180).
So, you need to set the below in the customize.yml as it incorrectly shows in kWh hours in HA, when the numbers are in Wh:
sensor.elec4_cm180i_5f_00_total_usage:
unit_of_measurement: Wh
Then a template sensor, if the CM180i returns a 0 value we don’t update the template sensor value (we just return the old value), converting only non-zero values to kWh hour:
- platform: template
sensors:
electricity_usage_kwh:
unit_of_measurement: 'kWh'
value_template: >
{% if states('sensor.elec4_cm180i_5f_00_total_usage') | float == 0 %}
{{ states('sensor.electricity_usage_kwh') }}
{% else %}
{{ states('sensor.elec4_cm180i_5f_00_total_usage') | float / 1000 }}
{% endif %}
Then use the template sensor to feed the utility meter:
utility_meter:
electricity_hourly_kwh:
source: sensor.electricity_usage_kwh
cycle: hourly
electricity_daily_kwh:
source: sensor.electricity_usage_kwh
cycle: daily
electricity_weekly_kwh:
source: sensor.electricity_usage_kwh
cycle: weekly
electricity_monthly_kwh:
source: sensor.electricity_usage_kwh
cycle: monthly
electricity_quarterly_kwh:
source: sensor.electricity_usage_kwh
cycle: quarterly
electricity_yearly_kwh:
source: sensor.electricity_usage_kwh
cycle: yearly
Works well with the mini-graph-card bar chart in lovelace, settting the aggregate_func to max
type: 'custom:mini-graph-card'
entities:
- entity: sensor.electricity_hourly_kwh
name: Electricity Usage - Hourly kWh
name: Electricity Usage - Hourly kWh
hours_to_show: 24
group_by: hour
aggregate_func: max
show:
graph: bar
Where should I put the code above to make this weork? Obviously I’ll need to chage the names of the sensors, but I’m a little confused as to what yaml file this all gets added to.
customize.yml
sensor.elec4_cm180i_5f_00_total_usage:
unit_of_measurement: Wh
configuration.yml
sensor:
- platform: template
sensors:
electricity_usage_kwh:
unit_of_measurement: 'kWh'
value_template: >
{% if states('sensor.elec4_cm180i_5f_00_total_usage') | float == 0 %}
{{ states('sensor.electricity_usage_kwh') }}
{% else %}
{{ states('sensor.elec4_cm180i_5f_00_total_usage') | float / 1000 }}
{% endif %}
utility_meter:
electricity_quarter_hourly_kwh:
source: sensor.electricity_usage_kwh
cycle: quarter-hourly
electricity_hourly_kwh:
source: sensor.electricity_usage_kwh
cycle: hourly
electricity_daily_kwh:
source: sensor.electricity_usage_kwh
cycle: daily
electricity_weekly_kwh:
source: sensor.electricity_usage_kwh
cycle: weekly
electricity_monthly_kwh:
source: sensor.electricity_usage_kwh
cycle: monthly
electricity_quarterly_kwh:
source: sensor.electricity_usage_kwh
cycle: quarterly
electricity_yearly_kwh:
source: sensor.electricity_usage_kwh
cycle: yearly
N.B. Assuming you already have a ‘sensor:’ key, don’t add it again other it will fail to load/validate - just add the ‘- platform: template’ as a new entry, nested below the others.
Lovelace, raw edit/manual add card:
type: 'custom:mini-graph-card'
entities:
- entity: sensor.electricity_hourly_kwh
name: Electricity Usage - Hourly kWh
name: Electricity Usage - Hourly kWh
hours_to_show: 24
group_by: hour
aggregate_func: max
show:
graph: bar
With some extra gauge as well:
Full Lovelace - requires mini-graph-card to be installed.
type: vertical-stack
cards:
- type: horizontal-stack
title: Live Electricity Usage
cards:
- type: gauge
entity: sensor.elec4_cm180i_5f_00_current_ch_1
min: 0
severity:
green: 0
yellow: 5
red: 30
max: 40
name: Amps
- type: gauge
entity: sensor.electricity_usage_live_w
min: 0
severity:
green: 0
yellow: 1000
red: 1200
max: 2000
name: Watts
- type: custom:mini-graph-card
entities:
- entity: sensor.electricity_hourly_kwh
name: Electricity Usage - Hourly kWh
name: Electricity Usage - Hourly kWh
hours_to_show: 48
group_by: hour
aggregate_func: max
show:
graph: bar
- type: custom:mini-graph-card
entities:
- entity: sensor.electricity_daily_kwh
name: Electricity Usage - Daily kWh
name: Electricity Usage - Daily kWh
hours_to_show: 168
group_by: date
aggregate_func: max
show:
graph: bar
- type: custom:mini-graph-card
entities:
- entity: sensor.electricity_weekly_kwh
name: Electricity Usage - Weekly kWh
name: Electricity Usage - Weekly kWh
hours_to_show: 336
group_by: date
aggregate_func: max
show:
graph: bar
- type: custom:mini-graph-card
entities:
- entity: sensor.electricity_monthly_kwh
name: Electricity Usage - Monthly kWh
name: Electricity Usage - Monthly kWh
hours_to_show: 336
group_by: date
aggregate_func: max
show:
graph: bar