JoDehli / PyLoxone

Python Loxone binding
Apache License 2.0
162 stars 40 forks source link

100.000 events and event_data in the HA db every 12 hours #235

Closed jakubklos77 closed 4 months ago

jakubklos77 commented 4 months ago

Describe the bug

I have noticed for the HA db to grow a lot. Eventually I ended up with setting:

# Log only the following
logbook:
  include:
    entity_globs:
      - light.*
      - switch.*
      - binary_sensor.mg_*

recorder:
  include:
    entity_globs:
      - light.*
      - switch.*
      - binary_sensor.mg_*

So basically only those 3 entity types should be recorded in the db. However, that is not true. About 100.000 events and event_data is recorded every 12 hours.

The database purge takes a huge time.

I don't think these events should be recorded at all due to the settings above. Can you please point me out to some better way to avoid this?

Thank you

Firmware of your Miniserver

Latest

HomeAssistant install method

RaspberryPi method

Version of HomeAssistant

Latest

Version of Pyloxone

Latest

Update pyloxone

n/a

Log

SELECT event_type_id, COUNT(*) as count FROM events GROUP BY event_type_id ORDER BY count DESC LIMIT 10;

event_type_id | count
5 | 325821

event_type_id 5 = loxone_event all new events after 1 day

JoDehli commented 4 months ago

Screenshot_20240119-194946.png

I @jakubklos77 I added this in my recorder config.

jakubklos77 commented 4 months ago

You the man! Thank you. That works great. I think it should be mentioned in the readme

JoDehli commented 3 months ago

@jakubklos77 I didn't know that I added this to my config. I realized it when you opened this issue. To add it in the readme is a good idea. If you want you can add it and make a pull request.

jakubklos77 commented 3 months ago

Thank you https://github.com/JoDehli/PyLoxone/pull/236