-
Notifications
You must be signed in to change notification settings - Fork 32
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
Incorrect water and energy information #544
Comments
Thank you for your detailed report. This problem has been identified before but did not get the attention it deserves. It results in more or less meaningless values if you try to create accumulated consumption sensors in HA. There is no safe way to work around the erroneous values. It should really be taken care of at the root. |
Thanks for the great integration, @astrandb! I'm also seeing the issue with incorrect consumption values. Apparently, Miele has not updated the API yet. As I'd still like to get consumption data into HA, I tried to use your workaround, @kinnkler. However, in my first attempt the sensors were "unavailable". I edited the code trying to make it more tolerant and easier to understand for me. But now constantly 0 gets reported. diff --git a/sensor.py b/sensor.py
index 5cee5bf..c250ce5 100644
--- a/sensor.py
+++ b/sensor.py
@@ -772,6 +772,7 @@ class MieleSensor(MieleEntity, SensorEntity):
self._last_elapsed_time_reported = None
self._last_started_time_reported = None
self._last_abs_time = {}
+ self.running_state_counter = 0
@property
def native_value(self):
@@ -860,15 +861,20 @@ class MieleSensor(MieleEntity, SensorEntity):
if self.entity_description.key in [
"stateCurrentEnergyConsumption",
"stateCurrentWaterConsumption",
- ] and state in [
- STATE_STATUS_ON,
- STATE_STATUS_OFF,
- STATE_STATUS_PROGRAMMED,
- STATE_STATUS_WAITING_TO_START,
- STATE_STATUS_IDLE,
- STATE_STATUS_SERVICE,
]:
- return 0
+ if state in [
+ STATE_STATUS_ON,
+ STATE_STATUS_OFF,
+ STATE_STATUS_PROGRAMMED,
+ STATE_STATUS_WAITING_TO_START,
+ STATE_STATUS_IDLE,
+ STATE_STATUS_SERVICE,
+ ]:
+ self.running_state_counter = 0
+ return 0
+ if state == STATE_STATUS_RUNNING and getattr(self, 'running_state_counter', 3) < 3:
+ self.running_state_counter += 1
+ return 0
if (
self.coordinator.data[self._ent].get(self.entity_description.data_tag) Would anyone be able to suggest what I'm doing wrong? |
Problem resolved, |
The problem
I have noticed an error regarding the water and energy data of my dishwasher. The error is not due to the HA integration but to the Miele API. The energy/water data is only displayed during the program and then reset to 0. However, when you start a new program, the Miele API displays the energy and water quantity of the last program in the event stream during the programming phase and also in the first event messages where the program is already running. This can be clearly seen in the following event stream. The first message is after I have entered the program. Then I start the machine and the status is “In Use”, but the old quantity is still displayed. Only with the second message with status “In Use” is it adjusted:
Since I use the two sensors with a HA-Utlity Meter, I always have incorrect energy quantities.
I have fixed this temporarily by only displaying the energy/water quantities after 3 messages with “Running”/“In Use” status:
Should I report this to Miele?
Version of miele integration having the issue?
2024.8.1
Version of Home Assistant Core having the issue?
2024.8.3
Anything in the logs that might be useful for us?
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: