gvigroux / hon

Support of all Haier, Candy, Hoover appliances integrated in the official hOn mobile app. Direct access to all possible services and parameters
MIT License
118 stars 45 forks source link

Add support to change Wine Cooler light on/off #28

Closed TroLoos closed 10 months ago

TroLoos commented 1 year ago

Hi, first of all - thank you for your great work, I was really surprised that my recently purchased Wine Cooler (HWS42GDAU1) is actually supported by this component 👍

It works great - I can read all the sensors:

Screenshot 2022-11-09 at 00 35 50

What it would make it even better - if it was possible to turn the light on and off from within HA. It would be a great addition to lighting automations (you enter the room, wine cooler's light goes on...).

If there's anything I can do here to help, just let me know (basic programming experience).

gvigroux commented 1 year ago

Hi, I've added a generic ligh service in this repo: https://github.com/gvigroux/hon/tree/Full-rework Can you try ?

TroLoos commented 1 year ago

Unfortunately, there are still no entities that could be switched on/off:

Screenshot 2023-03-22 at 18 48 22

It did change comparing to previous version:

Screenshot 2023-03-22 at 18 54 28

but all the entities are still sensors, light did not change to switch.

Thanks a lot for trying though :-). I'm sure it can be done, and I am ready to help testing.

gvigroux commented 1 year ago

I've updated the main branch so you can try from there. You have 2 services to start and stop the lights :) but it's still not a button.

TroLoos commented 1 year ago

I've updated the main branch so you can try from there. You have 2 services to start and stop the lights :) but it's still not a button.

@gvigroux, what a great support! ;-)

Indeed, there are services to be called, I've checked hon.turn_light_on and it works flawlessly. Looks like turn_light_off still needs a little bit of tweak, it doesn't do anything. Can you have a second look at it? Perhaps I can send a custom request but I don't know the schema to follow.

gvigroux commented 1 year ago

OUPS, light_off should works now :)

TroLoos commented 1 year ago

@gvigroux thank you a million!

I'm waiting for a change to propagate :-).

gvigroux commented 1 year ago

Done! Sorry it was stuck on my side

TroLoos commented 1 year ago

@gvigroux I'm going to say that again - what a support!

Everything works like a charm :-).

You can add it to fully supported list:

Device info HWS42GDAU1 by haier Firmware: 5.12.0

gvigroux commented 1 year ago

Thanks :)

TroLoos commented 10 months ago

@gvigroux I'm not sure when exactly, but this service (light on/off) stopped working with unknown error. Are there any information that I could provide to help you figure it out why it's not working?

Tried from NodeRed ("Call-service error. cannot access local variable 'json' where it is not associated with a value") and Developer Tools in HA ("Failed to call service hon.turn_light_on. Unknown error").

I'm on the newest available version of the add on.

gvigroux commented 10 months ago

Let me look at it

gvigroux commented 10 months ago

@TroLoos, it should work again now :) Can you please test ?

TroLoos commented 10 months ago

@gvigroux yes, you got it right! Works like a charm again.

Thank you!

gvigroux commented 10 months ago

Perfect :)