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

Incorrect timing shown for progress bar (Electrolux/AEG)

Open schumi2004 opened this issue 1 year ago • 5 comments

I have a few AEG devices integrated in HA using this integration: https://github.com/mauro-midolo/homeassistant_electrolux_status

After some trial and error i got a progress bar showing but it is giving me the wrong timings

vivaldi_KWJadiLAyv

Initially the sensor state is in minutes but i also created a sensor that converts it to hh:mm:ss But both are giving incorrect time.

This is my card config:

type: custom:timer-bar-card
entity: binary_sensor.aeg_wasmachine_apl_status
duration:
  entity: sensor.converted_time
debug: true

Any sugegstions?

schumi2004 avatar Jul 04 '23 10:07 schumi2004

Not sure what caused it but i'm closer to the correct timings now. The diff is now 15 min from actual time while it's bassicly the same code as previously used.

vivaldi_qguHB1DzOG

type: custom:timer-bar-card
icon: fapro:washing-machine
entities:
  - binary_sensor.aeg_wasmachine_apl_status
duration:
  entity: sensor.aeg_wasmachine_wm1_timetoend
  units: minutes
bar_foreground: orange
text_width: 5em
invert: true
mushroom: null

/edit: I was fooled. The timing diff increases the closer the program ends. Could it be something with a update delay of original sensor? The duration value (8460 seconds) seems to be correct except the remaining time on the bar is incorrect.

vivaldi_i967sp0lr4

/edit2: I think i'm missing the start_time value. I have a bar now but it's always full. Should this be provided by the integration or is there a workaround?

schumi2004 avatar Jul 05 '23 13:07 schumi2004

Great investigative work! I see the entity you're using for the duration is called sensor.aeg_wasmachine_wm1_timetoend, which sounds like it might be a better fit for the remain_time option instead. Is there another entity that gives you the duration that you could combine with the remaining time?

rianadon avatar Jul 06 '23 08:07 rianadon

Great investigative work! I see the entity you're using for the duration is called sensor.aeg_wasmachine_wm1_timetoend, which sounds like it might be a better fit for the remain_time option instead. Is there another entity that gives you the duration that you could combine with the remaining time?

Unfortunately this is the only timer available. I also tried remaining time but then the timings are off, from start to end it would differ almost 30-40min

schumi2004 avatar Jul 06 '23 16:07 schumi2004

Didn't this card calculate the start time by itself?

schumi2004 avatar Jul 10 '23 12:07 schumi2004

Got it fixed with the help of @jd1 from his issue here: https://github.com/rianadon/timer-bar-card/issues/96

This is the sensor i created:

- platform: template
  sensors:
    washing_machine_finish_time:
      friendly_name: "Washing Machine Finish Time"
      device_class: timestamp
      value_template: "{{ now() + timedelta(minutes=states('sensor.aeg_wasmachine_wm1_timetoend')|int) }}"

And this is my template card:

type: custom:timer-bar-card
icon: fapro:washing-machine
name: Wasmachine
entity: binary_sensor.aeg_wasmachine_apl_status
end_time:
  entity: sensor.washing_machine_finish_time
bar_foreground: orange
text_width: 5em
invert: true
mushroom: null
debug: true

And how it looks in GUI: image

schumi2004 avatar Jul 24 '23 12:07 schumi2004