bramstroker / homeassistant-powercalc

Custom component to calculate estimated power consumption of lights and other appliances
MIT License
1.02k stars 262 forks source link

PowerCalc Error Cannot find utility_meter component #1027

Closed Kilkenny-82 closed 2 years ago

Kilkenny-82 commented 2 years ago

Since recently going from 2022.7.7 to 2022.8.6 PowerCalc isn't working anymore. It says the utility_meter component could not be found. All the original power measuring devices work fine still.

This is the full error:

Deze fout is ontstaan door een aangepaste integratie.

Logger: custom_components.powercalc.sensor
Source: custom_components/powercalc/sensor.py:256
Integration: Powercalc (documentation, issues)
First occurred: 12:06:43 (16 occurrences)
Last logged: 12:06:43

Cannot find utility_meter component

And this is the part in my config file:

powercalc:
  create_utility_meters: true
  utility_meter_types:
    - daily
    - monthly
    - yearly
  utility_meter_tariffs:
    - peak
    - offpeak

Running v0.25.2 of PowerCalc since today on HA Core 2022.8.6

bramstroker commented 2 years ago

Was able to reproduce.

Could you add the following to your configuration.yaml which should resolve the issue?

utility_meter:
Kilkenny-82 commented 2 years ago

You mean as a main part within the configuration.yaml. Because it was already there, have the following that splits the configuration:

# Includes
homeassistant:
  packages: !include_dir_merge_named yaml/projects/

group: !include groups.yaml
automation: !include_dir_merge_list yaml/Automations/
script: !include scripts.yaml
scene: !include scenes.yaml
sensor gen: !include sensor.yaml
sensor log: !include sensor_log.yaml
sensor grocy: !include sensor_grocy.yaml
input_select: !include input_select.yaml
template: !include_dir_merge_list yaml/Templates/
input_boolean: !include input_boolean.yaml
shell_command: !include shell_command.yaml
input_datetime: !include Input_datetime.yaml
input_number: !include input_number.yaml
recorder: !include Recorder.yaml
history: !include History.yaml
logbook: !include Logbook.yaml
utility_meter: !include utility_meter.yaml
influxdb: !include Influxdb.yaml

I also have some utility_meter parts in some of the packages as well. Or should it be under the powercalc config part?

bramstroker commented 2 years ago

Could you try adding "utility_meter" to manifest.json file after "hue"? https://github.com/bramstroker/homeassistant-powercalc/blob/master/custom_components/powercalc/manifest.json#L12.

So you should edit config/custom_components/powercalc/manifest.json After that restart HA.

And see if this resolves the issue.

Kilkenny-82 commented 2 years ago

That indeed fixed the issue. This is the dependencies part of the manifest.json for me now:

    "dependencies": [
        "light",
        "group",
        "template",
        "select",
        "hue",
        "utility_meter"
    ],

Thanks for the quick help and solution

bramstroker commented 2 years ago

Nice, thanks for verifying. Fix will be in next version.