timer-bar-card icon indicating copy to clipboard operation
timer-bar-card copied to clipboard

Use a progress attribute/entity to draw the progress bar

Open jensrossbach opened this issue 1 year ago • 5 comments

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.

jensrossbach avatar Mar 11 '23 10:03 jensrossbach

Hello, I think you can find a solution here: https://github.com/rianadon/timer-bar-card/issues/36

SiL-X avatar Mar 22 '23 17:03 SiL-X

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.

jensrossbach avatar Mar 22 '23 18:03 jensrossbach

I think I understand your idea now. ^^

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

SiL-X avatar Mar 22 '23 20:03 SiL-X

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.

rianadon avatar Mar 23 '23 07:03 rianadon

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.

jensrossbach avatar Mar 23 '23 18:03 jensrossbach