primarytaya.blogg.se

Mysql create view specify column type
Mysql create view specify column type









When using the UI to call this service then it is mandatory to specify at least one entity_id using the Target Picker or via YAML mode. Note: The entity_id is only optional when used in automations.yaml or scripts.yaml. The default of 0 days will remove all matching rows. Number of history days to keep in the database of matching rows. Service data attributeĪ list of entity_ids that should be purged from the recorder database.Ī list of domains that should be purged from the recorder database.Ī list of regular expressions that identify entities to purge from the recorder database. Leaving all three parameters empty will result in all entities being selected for purging.

mysql create view specify column type mysql create view specify column type

Combine with repack: true to reduce database size.Ĭall the service recorder.purge_entities to start a task that purges events and states from the recorder database that match any of the specified entity_id, domains and entity_globs fields. Useful in combination with include / exclude filter to remove falsely added states and events. Only supported by SQLite, PostgreSQL, MySQL and MariaDB.Īpply entity_id and event_type filter in addition to time based purge. This is a heavy operation that can cause slowdowns and increased disk space usage while it runs. When using MySQL or MariaDB it will optimize or recreate the events and states tables. When using SQLite or PostgreSQL this will rewrite the entire database. The number of history days to keep in recorder database (defaults to the integration purge_keep_days configuration)

mysql create view specify column type

Note that purging will not immediately decrease disk space usage but it will significantly slow down further growth. # Example configuration.yaml entry with include and exclude recorder : include : domains : - sensor - switch - media_player exclude : entities : - sensor.last_boot - sensor.date entity_globs : - sensor.weather_* Services Service purgeĬall the service recorder.purge to start a purge task which deletes events and states older than x days, according to keep_days service data. blocklist) is convenient when you are basically happy with the information recorded, but just want to remove some entities or domains. Common filtering examplesĭefining domains and entities to exclude (i.e. That way they aren’t even in your database, you can reduce storage and keep the database small by excluding certain often-logged events (like sensor.last_boot). But if you have privacy concerns about certain events or want them in neither the history or logbook, you should use the exclude/ include options of the recorder integration. If you only want to hide events from your history, take a look at the history integration. ? - The question mark represents a single character * - The asterisk represents zero, one, or multiple characters The following characters can be used in entity globs: No Domain and/or glob includes or excludes.Otherwise, entity listed in exclude: exclude.Domain and/or glob excludes (no domain and/or glob includes).Otherwise, entity listed in entities exclude: exclude.Domain and/or glob includes (may also have excludes).Otherwise, entity matches glob exclude: exclude.Otherwise, entity matches domain exclude: exclude.Otherwise, entity matches glob include: include.Otherwise, entity matches domain include: include.Entity listed in entities include: include.# Example filter to include specified domains and exclude specified entities recorder : include : domains : - alarm_control_panel - light entity_globs : - binary_sensor.*_occupancy exclude : entities : - light.kitchen_light To change the defaults for the recorder integration in your installation, add the following to your configuration.yaml file: The database is stored in your Home Assistant configuration directory (’/config/’) and is named home-assistant_v2.db. The default, and recommended, database engine is SQLite which does not require any configuration. This makes it possible to use a number of database solutions.Īlthough SQLAlchemy supports database solutions in addition to the ones supported by Home Assistant, it will behave differently on different databases, and features relied on by the recorder may work differently, or not at all, in different databases. Home Assistant uses SQLAlchemy, which is an Object Relational Mapper (ORM).

mysql create view specify column type

30s, limit the amount of stored data (e.g., by excluding devices) or store the data elsewhere (e.g., another system). It is therefore recommended to set the commit_interval to higher value, e.g. In case of Raspberry Pi with an SD card, it might affect your system’s reaction time and life expectancy of the storage medium (the SD card). If you use the default configuration, the data will be saved on the media Home Assistant is installed on.











Mysql create view specify column type