-
-
Notifications
You must be signed in to change notification settings - Fork 33k
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
Allow to disable state write suppressing for MQTT sensors #140318
base: dev
Are you sure you want to change the base?
Conversation
Hey there @emontnemery, @bdraco, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
edd9549
to
c649101
Compare
I'm not sure about this, it doesn't seem like something integrations should need to concern themselves about. The PR which introduced the state filtering in MQTT, #100438, is older than the PR introducing the I'd rather disable the MQTT state filtering for numerical MQTT sensors, and maybe also non-numerical sensors and binary sensors, and evaluate mitigations if there are performance regressions. Related:
|
That would be really nice regardless of this PR, I used to run a query once in a while to list the top 10 entities which update states, I think having something like this under the |
0f8b631
to
f6ebf6a
Compare
I think this would be great to give users visibility into the amount of state writes. We have the same problem with lack of visibility as to how often they are updated in the database as well. One challenge I don't have a good answer for is what happens when the user has an important entity that is doing too many state writes. In previous issues and troubleshooting, we sometimes reach the conclusion that a specific entity is writing state too often, but the user does not want to disable it because they rely on it for an automation, or energy reporting. These tend to be MQTT entities fed by something external where they don't have control over how frequently the updates come in. |
Honestly, I really dislike this option. This is not something an external party should control or have concerns about. My vote is to no add this. ../Frenck |
I also don't like it, as per my previous answer. I set the PR to draft. |
Proposed change
Integrations can suppress unchanged state writes to not burden the state machine and recorder, MQTT is an integration which does that. Suppressing unchanged state writes however breaks the
last_reported
functionality which is used by sensor helpers.This PR adds an optional flag to MQTT
binary_sensor
and MQTTsensor
which disables the suppression of unchanged state writes.This PR is an alternative to #140001.
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: