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

Use a progress attribute/entity to draw the progress bar #76

Open
jensrossbach opened this issue Mar 11, 2023 · 5 comments
Open

Use a progress attribute/entity to draw the progress bar #76

jensrossbach opened this issue Mar 11, 2023 · 5 comments

Comments

@jensrossbach
Copy link

I have a Bosch dishwasher (via Home Connect) that provides an operation state and an ending time (although the entity is labeled "remaining program time" which obviously seems to be wrong) as information for the program operation. Additionally it provides an entity containing the progress as percentage value.

My request would be to give an option to use such progress entity or attribute for calculating/drawing the progress bar because this might be more reliable than computing the start time from the last changed timestamp of the main entity's state.

Maybe this request is somehow related to issue #73 but I'm not sure.

@SiL-X
Copy link

SiL-X commented Mar 22, 2023

Hello,
I think you can find a solution here: #36

@jensrossbach
Copy link
Author

Yes, I'm aware of this solution (and it's working). It's just a proposal for an extension because I thought that it's maybe more straightforward to use an existing "progress" value to draw the bar instead of calculating the progress value from other attributes in that case. I don't know if there are any drawbacks of such an approach.

@SiL-X
Copy link

SiL-X commented Mar 22, 2023

I think I understand your idea now. ^^

Maybe you safe a little bit of cpu? But I am not sure about that.

@rianadon
Copy link
Owner

You might be right that it could be easier to configure the card based off of the progress value and the ending time.

My request would be to give an option to use such progress entity or attribute for calculating/drawing the progress bar because this might be more reliable than computing the start time from the last changed timestamp of the main entity's state.

However, I'm not sure this would generally be true, since the progress value would be an integer percentage from 0-100, which is not as precise as a timestamp that has a resolution of seconds. I wouldn't be able to use the percentage to calculate an accurate estimate of the time remaining.

And yes sadly using the last changed timestamp is not the most reliable. If Home Assistant restarts during your timer or if the appliance is paused (is that a thing?), then you will have incorrect values. However, that's probably best solved by the integration providing an attribute for the start time.

@jensrossbach
Copy link
Author

However, I'm not sure this would generally be true, since the progress value would be an integer percentage from 0-100, which is not as precise as a timestamp that has a resolution of seconds. I wouldn't be able to use the percentage to calculate an accurate estimate of the time remaining.

Yes, I agree. Therefore I proposed to have this as an option so everybody could decide on his own if the percentage value should be used or some other value like the last changed attribute. I think for some use cases like e.g., the progress of a dishwasher, an integer based percentage value would be accurate enough.

And yes sadly using the last changed timestamp is not the most reliable. If Home Assistant restarts during your timer or if the appliance is paused (is that a thing?), then you will have incorrect values.

Yes, I think pausing would be a valid use case for a dishwasher or washing machine.

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

3 participants