Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion for illuminance change in common/everything-presence-lite-base.yaml #280

Open
ChristianRiesen opened this issue Jan 3, 2025 · 0 comments

Comments

@ChristianRiesen
Copy link

ChristianRiesen commented Jan 3, 2025

I have used a personal cobbled together presence (and illuminance) sensor before the lite came out and now replaced them all with the lite. Currently in the process of updating the configs as I do that by hand and came across this bit that I would like to offer as a suggestion to change it for the illuminance sensor. Instead of just making a pull request, I thought bringing it here first for a discussion would be a better way.

https://github.com/EverythingSmartHome/everything-presence-lite/blob/3dd563d5627b79cecd6edfa84250158d469ade05/common/everything-presence-lite-base.yaml#L66C1-L75C23

Basically change it from the above to this:

  - platform: bh1750
    name: Illuminance
    id: illuminance_sensor
    i2c_id: bus_a
    address: 0x23
    update_interval: "1s"
    accuracy_decimals: 1
    filters:
      - lambda: "return x + id(illuminance_offset_ui).state;"
      - delta: 1
      - clamp:
          min_value: 0

There are a couple small changes that I think would make the system much better.

  1. Add accuracy to 1 digit decimals. Everything below that is noise and not really useful.
  2. Add delta 1 filter, this means the sensor keeps reading, but only sends to HA when the lux changes 1 lux or more. Or in other words, only send to HA when there is a reason to send. Keeps spam low yet updates very quickly when there is a change.
  3. Set frequency to 1s for reads, abandoning the setting. With the delta above this is just no longer needed. I experimented with lower settings, but so far have not had much luck with below 1s readings. Specs say the sensor has a read time of 120 ms in the slowest mode (not sure which mode is used) so maybe quicker reads would work as well. In my testing I got some inconsistent results so I just left it at 1s for now.

The removal of a variable that is not needed, while getting less spam on HA or the network in general, yet have fast (1s) reactions on even modest light changes, I think would be an overall win for the presence lite.

Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant