sbidy / wiz_light

A WiZ Light integration for Home Assistant
MIT License
341 stars 68 forks source link

Wiz smart plug test #44

Closed jeffdeal closed 3 years ago

jeffdeal commented 3 years ago

Please don't post bugs or issues here This template is only for report a new bulb type for integration or successful test.

I have Wiz bulbs working successfully with your integration, so just for fun I bought a Wiz smart plug to try, model 9290024468. I also noticed that there are new Wiz strip lights and motion detectors available.

Provide the following information:

  1. Made an UDP request with nc to the bulb: echo '{"method":"getSystemConfig","params":{}}' | nc -u -w 1 <YOU BULB IP> 38899 Report the output here:

I was unable to download nc - my browsers and Windows itself quarantined as malware.

  1. Provide the native features of the bulb:

As this is only a smart plug, on/off is the only feature.

  1. Tested?

I defined the device just like a bulb in my configuration.yaml file. The device shows up and will successfully turn on! Then the device icon will flip back to "off" but the switch remains on. If I manually turn the switch off I can turn it on again from HA. There are continuous errors in the log file regarding brightness and dimmer functions, which of course this device does not support. But it seems the basics of operation with smart plugs is there and perhaps could be integrated relatively easily. I really like my Wiz bulbs and integration with Home Assistant is greatly appreciated. If I can help, I would be glad to do so.

sbidy commented 3 years ago

Thanks for the report. Yes that behavior can happen because of the mapping of an unknown device. If you add such an unknown device all features will be mapped to this device. In case that this will not support dimmer/brightness will cause this exception.

But to map the correct features to the bulb I need the nc output. Can you please try the echo '{"method":"getSystemConfig","params":{}}' | nc -u -w 1 <YOU BULB IP> 38899 from an Linux device in the network?

jeffdeal commented 3 years ago

Here's the output:

{"method":"getSystemConfig","env":"pro","result":{"mac":"a8bb509b64de","homeId":616906,"roomId":2594939,"moduleName":"ESP10_SOCKET_06","fwVersion":"1.20.0","groupId":0,"drvConf":[20,2],"ewf":[255,0,255,255,0,0,0],"ewfHex":"ff00ffff000000"}}

Thanks!

Jeff


From: Stephan Traub notifications@github.com Sent: Tuesday, November 3, 2020 2:39 AM To: sbidy/wiz_light wiz_light@noreply.github.com Cc: jeffdeal jeffdeal@hotmail.com; Author author@noreply.github.com Subject: Re: [sbidy/wiz_light] Wiz smart plug test (#44)

Thanks for the report. Yes that behavior can happen because of the mapping of an unknown device. If you add such an unknown device all features will be mapped to this device. In case that his will not support dimmer/brightness will cause this exception.

But to map the correct features to the bulb I need the nc output. Can you please try the echo '{"method":"getSystemConfig","params":{}}' | nc -u -w 1 38899 from an Linux device in the network?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fsbidy%2Fwiz_light%2Fissues%2F44%23issuecomment-720954807&data=04%7C01%7C%7C3ddf14e1adf742211e7608d87fcba19b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637399859843246598%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=6pSQkAGGr7rc2mp6VGzLCp73Y7ChSoNp2i%2FsjuPCaXA%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FARIKP2KAZLO5J4TV7PT2B7DSN6XT7ANCNFSM4SZXF2TA&data=04%7C01%7C%7C3ddf14e1adf742211e7608d87fcba19b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637399859843246598%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9A2mXmFDyKOcYGp1R2dP112FOcA5bjUuo8BrvqaW1ts%3D&reserved=0.

simora commented 3 years ago

I have a working switch.py to implement the socket. I'll clean it up and submit a PR later today.

simora commented 3 years ago

The following PR resolves this issue by adding support for the Wiz socket.

To implement add the following to your configuration.yaml

switch:
  - platform: wiz_light
    name: <Name of the device>
    host: <IP of the socket>

52

jeffdeal commented 3 years ago

I added your code to my config as a test - works great!

sbidy commented 3 years ago

I merged the pull to the code. Thank you for the contribution!!!