Interestingly, I don’t think this is an iBeacon, Looking at the sensors the dB number looks like it is very close to the pi3. There is other kit near it (switches, nas, x64 servers) but I have no iBeacons.
It also only seems to be the uuid sensor that is noisy.
This is the config to create the table. I apologise in advance as it was thrown together to get some stats. It needs optimising which is why I set a scan interval of 10 minutes.
~B
#
# This is pants but only way currently to get top n sql query results
#
- platform: sql
db_url: !secret db_url
scan_interval: 600
queries:
- name: HA Sensor2 Database Size
query: "SELECT ROUND(page_count * page_size,1)/1000000 as size FROM pragma_page_count(), pragma_page_size();"
column: "size"
unit_of_measurement: MB
- name: HA Sensor2 Database events
query: 'SELECT count(*) as number_events FROM events;'
column: number_events
- name: HA Sensor2 Database states
query: 'SELECT count(*) as number_states FROM states;'
column: number_states
- name: HA Sensor2 entity 01
query: "SELECT entity_id, COUNT(*) as count FROM states GROUP BY entity_id ORDER BY count DESC LIMIT 1;"
column: "entity_id"
- name: HA Sensor2 entity 02
query: "SELECT entity_id, COUNT(*) as count FROM states GROUP BY entity_id ORDER BY count DESC LIMIT 2;"
column: "entity_id"
- name: HA Sensor2 entity 03
query: "SELECT entity_id, COUNT(*) as count FROM states GROUP BY entity_id ORDER BY count DESC LIMIT 3;"
column: "entity_id"
- name: HA Sensor2 entity 04
query: "SELECT entity_id, COUNT(*) as count FROM states GROUP BY entity_id ORDER BY count DESC LIMIT 4;"
column: "entity_id"
- name: HA Sensor2 entity 05
query: "SELECT entity_id, COUNT(*) as count FROM states GROUP BY entity_id ORDER BY count DESC LIMIT 5;"
column: "entity_id"
- name: HA Sensor2 entity 06
query: "SELECT entity_id, COUNT(*) as count FROM states GROUP BY entity_id ORDER BY count DESC LIMIT 6;"
column: "entity_id"
- name: HA Sensor2 entity 07
query: "SELECT entity_id, COUNT(*) as count FROM states GROUP BY entity_id ORDER BY count DESC LIMIT 7;"
column: "entity_id"
- name: HA Sensor2 entity 08
query: "SELECT entity_id, COUNT(*) as count FROM states GROUP BY entity_id ORDER BY count DESC LIMIT 8;"
column: "entity_id"
- name: HA Sensor2 entity 09
query: "SELECT entity_id, COUNT(*) as count FROM states GROUP BY entity_id ORDER BY count DESC LIMIT 9;"
column: "entity_id"
- name: HA Sensor2 entity 10
query: "SELECT entity_id, COUNT(*) as count FROM states GROUP BY entity_id ORDER BY count DESC LIMIT 10;"
column: "entity_id"
- name: HA Sensor2 entity 11
query: "SELECT entity_id, COUNT(*) as count FROM states GROUP BY entity_id ORDER BY count DESC LIMIT 11;"
column: "entity_id"
- name: HA Sensor2 entity 12
query: "SELECT entity_id, COUNT(*) as count FROM states GROUP BY entity_id ORDER BY count DESC LIMIT 12;"
column: "entity_id"
- name: HA Sensor2 entity 13
query: "SELECT entity_id, COUNT(*) as count FROM states GROUP BY entity_id ORDER BY count DESC LIMIT 13;"
column: "entity_id"
- name: HA Sensor2 entity 14
query: "SELECT entity_id, COUNT(*) as count FROM states GROUP BY entity_id ORDER BY count DESC LIMIT 14;"
column: "entity_id"
- name: HA Sensor2 entity 15
query: "SELECT entity_id, COUNT(*) as count FROM states GROUP BY entity_id ORDER BY count DESC LIMIT 15;"
column: "entity_id"
- name: HA Sensor2 entity 16
query: "SELECT entity_id, COUNT(*) as count FROM states GROUP BY entity_id ORDER BY count DESC LIMIT 16;"
column: "entity_id"
- name: HA Sensor2 entity 17
query: "SELECT entity_id, COUNT(*) as count FROM states GROUP BY entity_id ORDER BY count DESC LIMIT 17;"
column: "entity_id"
- name: HA Sensor2 entity 18
query: "SELECT entity_id, COUNT(*) as count FROM states GROUP BY entity_id ORDER BY count DESC LIMIT 18;"
column: "entity_id"
- name: HA Sensor2 entity 19
query: "SELECT entity_id, COUNT(*) as count FROM states GROUP BY entity_id ORDER BY count DESC LIMIT 19;"
column: "entity_id"
- name: HA Sensor2 entity 20
query: "SELECT entity_id, COUNT(*) as count FROM states GROUP BY entity_id ORDER BY count DESC LIMIT 20;"
column: "entity_id"
Markdown Card to display
type: markdown
title: Top 20 DB Entities
content: >+
| Statistics | |
|:---|---:|
| Database size: | {{ '%3.3f' | format(
states('sensor.ha_sensor2_database_size') | float ) }} Mb |
| States table count: | {{ '%6.0f' | format(
states('sensor.ha_sensor2_database_states') | float ) }} |
| Events table count: | {{ '%6.0f' | format(
states('sensor.ha_sensor2_database_events') | float ) }} |
| | |
| | |
| | |
| Entity | States | {{' ' * 10}}% |
|:----|----:|---:|
| {{states('sensor.ha_sensor2_entity_01') }} |
{{state_attr('sensor.ha_sensor2_entity_01','count') }} | {{ '%2.2f' | format(
state_attr('sensor.ha_sensor2_entity_01','count') /
(states('sensor.ha_sensor2_database_states') ) | float * 100 ) }} |
| {{states('sensor.ha_sensor2_entity_02') }} |
{{state_attr('sensor.ha_sensor2_entity_02','count') }} | {{ '%2.2f' | format(
state_attr('sensor.ha_sensor2_entity_02','count') /
(states('sensor.ha_sensor2_database_states') ) | float * 100 ) }} |
| {{states('sensor.ha_sensor2_entity_03') }} |
{{state_attr('sensor.ha_sensor2_entity_03','count') }} | {{ '%2.2f' | format(
state_attr('sensor.ha_sensor2_entity_03','count') /
(states('sensor.ha_sensor2_database_states') ) | float * 100 ) }} |
| {{states('sensor.ha_sensor2_entity_04') }} |
{{state_attr('sensor.ha_sensor2_entity_04','count') }} | {{ '%2.2f' | format(
state_attr('sensor.ha_sensor2_entity_04','count') /
(states('sensor.ha_sensor2_database_states') ) | float * 100 ) }} |
| {{states('sensor.ha_sensor2_entity_05') }} |
{{state_attr('sensor.ha_sensor2_entity_05','count') }} | {{ '%2.2f' | format(
state_attr('sensor.ha_sensor2_entity_05','count') /
(states('sensor.ha_sensor2_database_states') ) | float * 100 ) }} |
| {{states('sensor.ha_sensor2_entity_06') }} |
{{state_attr('sensor.ha_sensor2_entity_06','count') }} | {{ '%2.2f' | format(
state_attr('sensor.ha_sensor2_entity_06','count') /
(states('sensor.ha_sensor2_database_states') ) | float * 100 ) }} |
| {{states('sensor.ha_sensor2_entity_07') }} |
{{state_attr('sensor.ha_sensor2_entity_07','count') }} | {{ '%2.2f' | format(
state_attr('sensor.ha_sensor2_entity_07','count') /
(states('sensor.ha_sensor2_database_states') ) | float * 100 ) }} |
| {{states('sensor.ha_sensor2_entity_08') }} |
{{state_attr('sensor.ha_sensor2_entity_08','count') }} | {{ '%2.2f' | format(
state_attr('sensor.ha_sensor2_entity_08','count') /
(states('sensor.ha_sensor2_database_states') ) | float * 100 ) }} |
| {{states('sensor.ha_sensor2_entity_09') }} |
{{state_attr('sensor.ha_sensor2_entity_09','count') }} | {{ '%2.2f' | format(
state_attr('sensor.ha_sensor2_entity_09','count') /
(states('sensor.ha_sensor2_database_states') ) | float * 100 ) }} |
| {{states('sensor.ha_sensor2_entity_10') }} |
{{state_attr('sensor.ha_sensor2_entity_10','count') }} | {{ '%2.2f' | format(
state_attr('sensor.ha_sensor2_entity_10','count') /
(states('sensor.ha_sensor2_database_states') ) | float * 100 ) }} |
| {{states('sensor.ha_sensor2_entity_11') }} |
{{state_attr('sensor.ha_sensor2_entity_11','count') }} | {{ '%2.2f' | format(
state_attr('sensor.ha_sensor2_entity_11','count') /
(states('sensor.ha_sensor2_database_states') ) | float * 100 ) }} |
| {{states('sensor.ha_sensor2_entity_12') }} |
{{state_attr('sensor.ha_sensor2_entity_12','count') }} | {{ '%2.2f' | format(
state_attr('sensor.ha_sensor2_entity_12','count') /
(states('sensor.ha_sensor2_database_states') ) | float * 100 ) }} |
| {{states('sensor.ha_sensor2_entity_13') }} |
{{state_attr('sensor.ha_sensor2_entity_13','count') }} | {{ '%2.2f' | format(
state_attr('sensor.ha_sensor2_entity_13','count') /
(states('sensor.ha_sensor2_database_states') ) | float * 100 ) }} |
| {{states('sensor.ha_sensor2_entity_14') }} |
{{state_attr('sensor.ha_sensor2_entity_14','count') }} | {{ '%2.2f' | format(
state_attr('sensor.ha_sensor2_entity_14','count') /
(states('sensor.ha_sensor2_database_states') ) | float * 100 ) }} |
| {{states('sensor.ha_sensor2_entity_15') }} |
{{state_attr('sensor.ha_sensor2_entity_15','count') }} | {{ '%2.2f' | format(
state_attr('sensor.ha_sensor2_entity_15','count') /
(states('sensor.ha_sensor2_database_states') ) | float * 100 ) }} |
| {{states('sensor.ha_sensor2_entity_16') }} |
{{state_attr('sensor.ha_sensor2_entity_16','count') }} | {{ '%2.2f' | format(
state_attr('sensor.ha_sensor2_entity_16','count') /
(states('sensor.ha_sensor2_database_states') ) | float * 100 ) }} |
| {{states('sensor.ha_sensor2_entity_17') }} |
{{state_attr('sensor.ha_sensor2_entity_17','count') }} | {{ '%2.2f' | format(
state_attr('sensor.ha_sensor2_entity_17','count') /
(states('sensor.ha_sensor2_database_states') ) | float * 100 ) }} |
| {{states('sensor.ha_sensor2_entity_18') }} |
{{state_attr('sensor.ha_sensor2_entity_18','count') }} | {{ '%2.2f' | format(
state_attr('sensor.ha_sensor2_entity_18','count') /
(states('sensor.ha_sensor2_database_states') ) | float * 100 ) }} |
| {{states('sensor.ha_sensor2_entity_19') }} |
{{state_attr('sensor.ha_sensor2_entity_19','count') }} | {{ '%2.2f' | format(
state_attr('sensor.ha_sensor2_entity_19','count') /
(states('sensor.ha_sensor2_database_states') ) | float * 100 ) }} |
| {{states('sensor.ha_sensor2_entity_20') }} |
{{state_attr('sensor.ha_sensor2_entity_20','count') }} | {{ '%2.2f' | format(
state_attr('sensor.ha_sensor2_entity_20','count') /
(states('sensor.ha_sensor2_database_states') ) | float * 100 ) }} |