The Recorder: component allows for the exclusion of entities. I would like to have the ability to exclude the services below. I have to delete these events from the database every 10 mins which from what I observe, compose 95% of the size and rows of the database while not doing anything for the logbook. Thanks
#!/bin/sh
mysql -uhass -phass HOMEBASE --execute="USE HOMEBASE";
mysql -uhass -phass HOMEBASE --execute="DELETE FROM events WHERE event_type = 'service_removed'";
mysql -uhass -phass HOMEBASE --execute="DELETE FROM events WHERE event_type = 'service_executed'";
mysql -uhass -phass HOMEBASE --execute="DELETE FROM events WHERE event_type = 'platform_discovered'";
mysql -uhass -phass HOMEBASE --execute="DELETE FROM events WHERE event_type = 'homeassistant_start'";
mysql -uhass -phass HOMEBASE --execute="DELETE FROM events WHERE event_type = 'feedreader'";
mysql -uhass -phass HOMEBASE --execute="DELETE FROM events WHERE event_type = 'service_registered'";
mysql -uhass -phass HOMEBASE --execute="DELETE FROM events WHERE event_type = 'call_service'";
mysql -uhass -phass HOMEBASE --execute="DELETE FROM events WHERE event_type = 'component_loaded'";
mysql -uhass -phass HOMEBASE --execute="DELETE FROM events WHERE event_type = 'logbook_entry'";
mysql -uhass -phass HOMEBASE --execute="DELETE FROM events WHERE event_type = 'system_log_event'";
mysql -uhass -phass HOMEBASE --execute="OPTIMIZE TABLE EVENTS;"
Thanks, it seems to work great. Only state changes recorded. It would be nice to have an include filter as well so I can just include state_changes instead of excluding everything else.
I tried to find out how to add this to the official documentation but I am unsure how. Please add to the official documentation as I think its a really important feature that will make most peoples HA run better. I would even suggest state_change only events be recorded as default.