fuslwusl / homeassistant-edl21-custom-interval

A replacement for the core edl21 sml integration with configurable scan interval to get a lot more detailed power usage info
Apache License 2.0
14 stars 4 forks source link

Setup failed for custom integration 'edl21': No setup or config entry setup function defined. #6

Open michaele1410 opened 9 months ago

michaele1410 commented 9 months ago

Hi i cloned the git repo and moved the files to the custom_components-folder. /homeassistant/config/custom_components/edl21/

The component works and the custom interval works correctly with in my case 10s.

nevertheless after rebooting i get the following error:

`Logger: homeassistant.setup Source: setup.py:221 First occurred: 09:49:44 (1 occurrences) Last logged: 09:49:44

Setup failed for custom integration 'edl21': No setup or config entry setup function defined.`

2024-02-07 09:48:46.831 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration edl21 which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-02-07 09:48:46.839 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-02-07 09:49:30.933 WARNING (MainThread) [homeassistant.setup] Setup of hassio is taking over 10 seconds. 2024-02-07 09:49:42.564 WARNING (MainThread) [homeassistant.const] ELECTRIC_CURRENT_AMPERE was used from edl21, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfElectricCurrent.AMPERE instead, please report it to the author of the 'edl21' custom integration 2024-02-07 09:49:42.585 WARNING (MainThread) [homeassistant.const] ELECTRIC_POTENTIAL_VOLT was used from edl21, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfElectricPotential.VOLT instead, please report it to the author of the 'edl21' custom integration 2024-02-07 09:49:42.605 WARNING (MainThread) [homeassistant.const] ENERGY_KILO_WATT_HOUR was used from edl21, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfEnergy.KILO_WATT_HOUR instead, please report it to the author of the 'edl21' custom integration 2024-02-07 09:49:42.626 WARNING (MainThread) [homeassistant.const] ENERGY_WATT_HOUR was used from edl21, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfEnergy.WATT_HOUR instead, please report it to the author of the 'edl21' custom integration 2024-02-07 09:49:42.645 WARNING (MainThread) [homeassistant.const] FREQUENCY_HERTZ was used from edl21, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfFrequency.HERTZ instead, please report it to the author of the 'edl21' custom integration 2024-02-07 09:49:42.664 WARNING (MainThread) [homeassistant.const] POWER_WATT was used from edl21, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfPower.WATT instead, please report it to the author of the 'edl21' custom integration 2024-02-07 09:49:44.308 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration 'edl21': No setup or config entry setup function defined. 2024-02-07 09:50:13.845 WARNING (SyncWorker_2) [homeassistant.components.rpi_power.binary_sensor] Under-voltage was detected. Consider getting a uninterruptible power supply for your Raspberry Pi. 2024-02-07 09:50:18.385 WARNING (MainThread) [homeassistant.components.netatmo] Webhook not registered - https and port 443 is required to register the webhook

idontknow79 commented 9 months ago

Same problem here.

DasPflanze commented 9 months ago

Yes, I have this error aswell.

fuslwusl commented 8 months ago

There are just warnings about required code changes till HA 2025.1. I will update the code till then or inform about a replacement.

fuslwusl commented 8 months ago

Here is a workaround if you are afraid of those warnings: https://github.com/home-assistant/core/issues/83918

deluxestyle commented 8 months ago

Here is a workaround if you are afraid of those warnings: home-assistant/core#83918

seems the workaround is not working anymore https://github.com/home-assistant/core/issues/83918#issuecomment-2008975098

123thomasme commented 7 months ago

I have the same problem Setup failed for custom integration 'edl21': No setup or config entry setup function defined any solutions?

dg3feh commented 7 months ago

Does not work! Any hints to hardcode the interval somehow?

Scharmen commented 5 months ago

@fuslwusl looks like the workaround with HO internal automation are not working anymore.

Do you have any plans to update your code ? Thank you

Scharmen commented 5 months ago

@fuslwusl i had some time and i updated the code on my own. For me everything works and no Warnings anymore. I updated the sensor.py file.

I hope its fine for you if i publish this here. Feel free to take it over.

Just replace the sensor file with this one: sensor.zip

fuslwusl commented 5 months ago

Thanx to @Scharmen for his fix. I created a new release 2.1.0 a few minutes ago that should be free of warnings.

LukasNitsche commented 4 months ago

Hi @fuslwusl, I am using 2.1.0 with HASS 2024.7.2 and I had the core EDL21 setup. I still have the issue as described in this thread. The sensor is working and updateing every 10 s, but the message remains and the EDL21 integration is showing as not loaded.

fuslwusl commented 4 months ago

@LukasNitsche Are you sure you uninstalled the official integration? If you want to update to the latest version of edl21 (same version that is shipped with the homeassistant release) here is a pre-release that is running fine in my setup: https://github.com/fuslwusl/homeassistant-edl21-custom-interval/releases/tag/3.0.0 Make a Backup first because this update uses a new configuration flow a migration should update your settings. In my case everything worked as expected. But i cannot give support to everyone.

LukasNitsche commented 4 months ago

@fuslwusl Thank you for your response! I followed the following process:

  1. Deleted old edl21 files in custom_components.
  2. Deleted the edl21 integration in devices.
  3. Deleted any edl21 entries in configuration.yaml
  4. Restarted HASS
  5. Added new version to custom_components.
  6. Restarted HASS
  7. Followed the UI Flow.

Now everything works without warning. Thank you!

P.S. For a read out every 6 seconds, and this data being kept by standard for 10 days, this results in 144,000 data points. Do you have any experience that this causes problems? Do you have your recorder set to a lower value (for these sensors)?

fuslwusl commented 4 months ago

I am using an edl21 interval of 3 seconds and my recorder size ist below 500 MB with 3 days of data. Recorder using sqlite is for short term storage and graphs. A large sqlite database of a few GB could slow down homeassistant and make backups run very long.

Here are my recorder settings:

recorder:
  commit_interval: 10
  purge_keep_days: 3
  auto_purge: true
  db_retry_wait: 5
  exclude:
    domains:
      - device_tracker
      - uptime
      - time_date
      - worldclock
      - media_player
      - automation
    entity_globs:
      - sensor.clock*
      - sensor.date*
      - sensor.glances*
      - sensor.time*
      - sensor.uptime*
    ...

You should exclude the stuff you do not need and changes very frequently.

If you need long term storage you should use a time series database like VictoriaMetric or InfluxDB. Energy consumption is the perfect match for a time series database running in parallel to recorder.

Here is some info for you: https://github.com/fuslwusl/homeassistant-addon-victoriametrics VictoriaMetrics is very efficient in storing data and I am using it since years without a single problem. Grafana for visualizing the data works great with it. My VictoriaMetrics database contains the last years of data is about 600 MB and I store all my energy data and nearly all sensor values (current power of smart meter every 3 seconds, inverter data every second, temperatures on every change...). It will never slow down homeassistant and requires only a few MB of RAM.

LukasNitsche commented 4 months ago

Seems like a very smart approach, but also to have too many dependencies for me to want to rely on. I will use exclude more to reduce db file size and if its really the meter values, I will use a template sensor with a lower scan interval, exclude the 6 s values from recorder and only use it for automations.

Are there any plans to bring your fork of the edl21 integration to HACS? Would be nice for easy updates through the UI.