this post was submitted on 01 Apr 2024
18 points (100.0% liked)

homeassistant

12051 readers
41 users here now

Home Assistant is open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server. Available for free at home-assistant.io

founded 1 year ago
MODERATORS
 

The other day, @tifriis@sh.itjust.works posted an awesome article about Zigbee network performance and it brought attention to something I was unaware of, which is that my devices aren't supposed to shout all day, everyday about doing mostly nothing. I immediately followed the advice in the article and tried to debounce everything. But then everything stopped working like it should ๐Ÿ˜‚ Can the community pool your collective knowledge and walk me through debouncing so I can not get MQTT spam but still have all my motion, presence and temperature sensors work please?

you are viewing a single comment's thread
view the rest of the comments
[โ€“] sabreW4K3@lazysoci.al 1 points 7 months ago (1 children)

found my database grew in size very quickly

Hold me! I'm dealing with that and haven't figured out how to fix it. How does the templating thing work? All my devices are Tuya devices, so you can imagine how quickly my database balloons up.

[โ€“] CondorWonder@lemmy.ca 4 points 7 months ago (2 children)

First thing - exclude recording of the devices. My method was to use a glob so I name devices/entity IDs specifically and they don't get recorded (in my case I used f_ as in "filtered" so devices become like "F Source Presence"), but you can add specific entities or use your own glob. In configuration.yaml I have this:

recorder:
  exclude:
    entities:
      - sensor.excluded_entity_1
    # AND/OR this (then of course rename entities as needed)
    entity_globs:
      # exclude all sensor entities that start with f_
      - sensor.f_*

Then I created templates for my presence sensors, that just copy the state so I get history (yaml here, but can do through UI now too in the Helpers section, the import part is the template in the state key below):

template:
  - binary_sensor:
      - name: Real presence
        unique_id: my_presence
        state: >-
          {{ states('binary_sensor.f_source_presence}}
        availability: >-
          {{
            not (
              states('binary_sensor.f_source_presence') == 'unknown' or
              states('binary_sensor.f_source_presence') == 'unavailable'
            )
          }}
        device_class: presence

You could also use a statistics sensor to get a moving average for numeric values and get history from them too (and reduce the noise by reducing the precision and having a larger time window). This is also available through the UI - Helpers.

[โ€“] sabreW4K3@lazysoci.al 2 points 7 months ago (1 children)

Random one, but do you think it's possible to use the new label system to create the filter group?

[โ€“] CondorWonder@lemmy.ca 2 points 7 months ago (1 children)

Not according to the integration documentation: https://www.home-assistant.io/integrations/recorder/

The recorder integration only supports: domains, entities, events, and entity globs right now. I think thatโ€™s a good idea though, should check or create an enhancement request!

[โ€“] sabreW4K3@lazysoci.al 2 points 7 months ago (1 children)

I went to create an enhancement request, but it's just creating a thread on their forums ๐Ÿ˜ฎโ€๐Ÿ’จ

[โ€“] CondorWonder@lemmy.ca 2 points 7 months ago (1 children)

Iirc thatโ€™s where they start ERs yes - itโ€™s easier to see, vote, and comment on them there compared to GitHub. Itโ€™s also the source for the month of WTF where it seemed like a lot of the easier ERs get addressed.

[โ€“] sabreW4K3@lazysoci.al 2 points 7 months ago

Guess I'll have to finally sign up to their forums

[โ€“] sabreW4K3@lazysoci.al 1 points 7 months ago

Thank you so much