sampsyo / hass-smartthinq

Home Assistant component for LG SmartThinQ HVAC devices
MIT License
282 stars 98 forks source link

add Washer #30

Open PawelTroka opened 4 years ago

PawelTroka commented 4 years ago

since Washer is already exposed in https://github.com/sampsyo/wideq, it should be pretty straightforward to map existing entities to Home Assistant

dieneuser commented 4 years ago

I would also be happy if the plugin would support washing machines.

The following code I get from wideq example.py when the washer is running:

State: @WM_STATE_RUNNING_W
Remain_Time_H: 1 (0-30)
Remain_Time_M: 33 (0-59)
Initial_Time_H: 1 (0-30)
Initial_Time_M: 41 (0-59)
Wash: @WM_TITAN2_OPTION_WASH_NORMAL_W
SpinSpeed: @WM_TITAN2_OPTION_SPIN_1200_W
WaterTemp: @WM_TITAN2_OPTION_TEMP_40_W
RinseOption: @WM_TITAN2_OPTION_RINSE_NORMAL_W
DryLevel: -
Reserve_Time_H: 0 (3-19)
Reserve_Time_M: 0 (0-59)
PreState: @WM_STATE_DETECTING_W
TCLCount: 40 (0-60)
LoadItem: 0
CourseType: 0
CourseType: 0
Standby: @CP_OFF_EN_W_
rwarner commented 4 years ago

Would also love to help expose this, just got an LG washer and setup thinq

gvdhoven commented 4 years ago

@PawelTroka and @rwarner can you also give an example output just like @dieneuser did? I am planning on adding it in: https://github.com/sampsyo/hass-smartthinq/pull/32

rwarner commented 4 years ago

@Webunity sure thing, I would love to. Last time I ran example.py however for some sample output on the network it didn't seem to find the Washer at all. Just gave me blank output.

I think other people are encountering the same thing here: https://github.com/sampsyo/wideq/issues/46

Any suggestions on how to proceed?

BottlecapDave commented 4 years ago

I just downloaded the latest code from wideq, setup a new account and managed to find and poll my washing machine. I've managed to add a new washing machine sensor to your code which seems to be working. I don't mind creating a pull request if that helps?

scrol8 commented 4 years ago

Good day. I installed the server HA as a virtual machine with Ubuntu. Installed your plugin wideq. Can I do something to help add refrigerator LG support?

JeedHome44 commented 4 years ago

hi, sorry for my bad english. i'm french. i add your github in my Home assistant. I only have a washer. do you know when it will be available please? Thank you for your work ;)

JeedHome44 commented 4 years ago

I can test the addon for you with my washing machine if you tell me how to do it. thank you

maarxx commented 4 years ago

Hello everybody. Great work! Very appreciative! The only LG appliance I have is a (clothes) washing machine. I saw some indications that this wasn't supported, but saw some mixed messages too, so I just tried it anyway.

I followed instructions today on this repo, master branch, and setup hass-smartthing. As it advises, I also set up wideq (also today, master branch) in a temp folder to get a refresh_token.

When I use wideq standalone CLI example.py, I see my washing machine (in ls, with a UUID), and if I do mon UUID on the washing machine, it correctly spams the device status out to the terminal. So I know this part is working.

I know that Home Assistant correctly loaded this as custom_component and the component is running, because at first, every time I rebooted Home Assistant, it threw an error regarding token problem to Notifications and to Logs. I then figured out this was because I used access_token instead of refresh_token, fixed the token accordingly, and it no longer puts any error messages into Notifications or into Logs. So for (only) this reason (errors, then no more errors), I think the component is properly loaded and is running.

But I check Developer Tools -> States and scroll the list of current entities, and I do not see anything new regarding a washing machine. Am I looking in the correct place? If this was working, should I be correct in expecting a new entity to magically appear in this list? Do I have the correct state of the problem as per this Issue #30 thread here? Or am I misunderstanding how to use it?

If I have the correct understanding of the issue, is there anything that I can do to get the washing machine to appear? Is there a custom branch or custom fork of this which might provide this type of support?

Hello @BottlecapDave I see here that you commented saying you were able to add this entity. Is this something you might be able to share? (I creeped on your public repos but did not see a fork.)

BottlecapDave commented 4 years ago

Sorry I've been quiet. I was wanting to look at the othe forks of this repo to see what they'd implemented but I haven't found the time.

So I've pushed my fork of this repo to https://github.com/BottlecapDave/hass-smartthinq which includes my washer sensor. Disclaimer - My washing machine is a UK branded one that was purchased ~ 2 years ago so I can't guarantee that other regions/older/newer washing machines will work as well.

I've also updated the base entity to include a unique id so that you can change the name in the Home Assistant UI.

maarxx commented 4 years ago

Thanks @BottlecapDave !

It worked flawlessly. I only had to switch to your fork, restart Home Assistant, and my washing machine immediately appeared as a sensor entity in Developer Tools -> States.

For anyone here less tech savvy, the approximate steps to switch to Dave's version is something like this:

cd ~/.homeassistant/custom_components/smartthinq/
git remote add bottlecapdave git@github.com:BottlecapDave/hass-smartthinq.git
git fetch bottlecapdave
git checkout bottlecapdave/master
bakazm commented 4 years ago

BottlecapDave's fork works great with my new LG washer. I'm in the US. My dishwasher still shows up correctly too. Now I just need the dryer. Might try to look at the code to see how easy it would be to add it.

JeedHome44 commented 4 years ago

This github work very well with washer! i use it! it's very simple to add this in Hassio! https://github.com/ollo69/ha-smartthinq-sensors