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

LG ThinQ Washer/Dryer Data not working #15

Closed
iDVB opened this issue Jul 27, 2021 · 9 comments
Closed

LG ThinQ Washer/Dryer Data not working #15

iDVB opened this issue Jul 27, 2021 · 9 comments

Comments

@iDVB
Copy link

iDVB commented Jul 27, 2021

First off, amazing card you have here. I'm just new to it and seem to be unable to get it working with my Device entities.

I use the LG ThinQ HACS integration to get my Washer and Dryer data.
The Dryer looks like this...
image

It appears each needed bit of data is in a separate entity. It seems in order to plot an accurate progress bar you would need two entities:
sensor.dryer_remain_time = 0:07
and
sensor.dryer_initial_time = 0:20

The next problem is that these times are written in the m:s format which there doesn't seem to be support for.

Perhaps, adding support for defining a template for the calculation and maybe a format string to define the format the values are coming in as.

@rianadon
Copy link
Owner

rianadon commented Jul 27, 2021

Ahahha thank you! You ask for a lot.

You should already be able take data from other entities: see this section. I'm reluctant to add in templating because that requires a lot more code, and Home Assistant itself already has so much templating power.

Since this integration is wacky, how about using the template integration?

I haven't tested this, but something like the following might work for you:

template:
  - sensor:
      - name: "Dryer Timer"
        state: "{{ states('sensor.dryer') }}"
        attributes:
          duration: "0:{{ states('sensor.dryer_initial_time') }}" # 0: in front to format the time correctly

Then create the card by setting only entity: (nothing else required)!

As long as the template picks up state changes, its last_changed property should be accurate, which means you don't need the remaining time.

@iDVB
Copy link
Author

iDVB commented Jul 27, 2021

Thanks @rianadon ! i thought there must be some kinda template solution outside of the card but not familiar with that. If it updates, should work fine.

Oh, and I guess the last_changed will carry the value when it was last changed? Let me give this a try. Cheers!

UPDATE -
I messed up and I think the format is actually h:m so your solution I think would be:

template:
  - sensor:
      - name: "Dryer Timer"
        state: "{{ states('sensor.dryer') }}"
        attributes:
          duration: "{{ states('sensor.dryer_initial_time') }}:0" # :0 at the end to format the time correctly

@rianadon
Copy link
Owner

Let me know if it works!

And if you do get it working and you're down to create a pull request, I'd love to add this to the examples!

@kareem613
Copy link

Looks like the LG integration has since changed. This is what the attributes look like with debug:true

Attr: {"run_completed":"off","error_state":"off","initial_time":"0:29","remain_time":"0:10","reserve_time":"0:00","current_course":"Normal","run_state":"Rinsing","pre_state":"Washing","error_message":"-","spin_speed":"High","water_temp":"Warm","dry_level":"Not Selected","tubclean_count":"41","remote_start":"on","door_close":"on","child_lock":"off","steam":"off","pre_wash":"off","turbo_wash":"on","friendly_name":"Washer","icon":"mdi:washing-machine","supported_features":3}

I think the issue here is the initial_time is the total time for the timer. ie. There are no timestamps.
remaining_time is already calculating how much time is left.

Is this usable without having timestamps?

@rianadon
Copy link
Owner

You can totally set the card up configuring only initial_time as duration, but then the start time will be calculated at the mercy of whenever the washer changes state, so you may or may not have success.

It would be really nice if that integration gave timestamps.

@lcavalli
Copy link

I asked the LG SmarthingQ integration maintainer and he kindly updated the integration adding the seconds to time attributes in version 0.12.3.

@funtastix
Copy link
Contributor

funtastix commented Jun 7, 2022

You can totally set the card up configuring only initial_time as duration, but then the start time will be calculated at the mercy of whenever the washer changes state, so you may or may not have success.

It would be really nice if that integration gave timestamps.

I've had the same issue. I've created a pull request: #47 to fix that LG integration for me.

Now I can do:

type: custom:timer-bar-card
debug: false
duration:
  attribute: initial_time
remaining:
  attribute: remain_time

@rianadon
Copy link
Owner

Now that #47 has just landed in the codebase, it's possible to use the card with the integration. The remain_time option will automatically identify the LG device's attribute, so it doesn't need configuring.

All you need is:

type: custom:timer-bar-card
duration:
  attribute: initial_time

I'm sorry it took so long for me to merge the PR.

@liyuxuan7762
Copy link

Hello there, I am very new to HA, could you tell me how to config the initial time?

Image

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

6 participants