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

[Feature Request] Wyze Color Bulbs #126

Closed
npeskoe opened this issue Mar 31, 2021 · 39 comments · Fixed by #129
Closed

[Feature Request] Wyze Color Bulbs #126

npeskoe opened this issue Mar 31, 2021 · 39 comments · Fixed by #129
Assignees
Labels
Feature Request New feature or request

Comments

@npeskoe
Copy link

npeskoe commented Mar 31, 2021

Wyze app is authenticating properly, but it is not finding bulb. Does this integration work with new color bulbs?

Logger: custom_components.wyzeapi
Source: custom_components/wyzeapi/init.py:80
Integration: Wyze Bulb and Switch Api Integration (documentation)
First occurred: 9:38:04 AM (1 occurrences)
Last logged: 9:38:04 AM

WyzeApi authenticated but could not find any devices.


Wyze Bulb and Switch Home Assistant Integration
Version: v0.5.12
This is a custom integration
If you have any issues with this you need to open an issue here:
https://github.com/JoshuaMulliken/ha-wyzeapi/issues

2021-03-31 09:37:57 DEBUG (MainThread) [custom_components.wyzeapi] Creating new WyzeApi component
2021-03-31 09:37:57 DEBUG (MainThread) [custom_components.wyzeapi.wyzeapi.client] Running login
2021-03-31 09:37:57 DEBUG (MainThread) [custom_components.wyzeapi.wyzeapi.client] Running __create_md5_md5
2021-03-31 09:38:01 WARNING (MainThread) [homeassistant.setup] Setup of zone is taking over 10 seconds.
2021-03-31 09:38:04 DEBUG (MainThread) [custom_components.wyzeapi] Connected to Wyze account
2021-03-31 09:38:04 DEBUG (MainThread) [custom_components.wyzeapi] Starting WyzeApi components
2021-03-31 09:38:04 DEBUG (MainThread) [custom_components.wyzeapi] Starting WyzeApi Lights
2021-03-31 09:38:04 ERROR (MainThread) [custom_components.wyzeapi] WyzeApi authenticated but could not find any devices.
2021-03-31 09:38:04 DEBUG (MainThread) [custom_components.wyzeapi.light] Creating new WyzeApi light component
2021-03-31 09:38:04 DEBUG (MainThread) [custom_components.wyzeapi.wyzeapi.client] Running list_bulbs
2021-03-31 09:38:04 DEBUG (MainThread) [custom_components.wyzeapi.wyzeapi.client] Running get_devices

@npeskoe npeskoe added the bug Something isn't working label Mar 31, 2021
@SecKatie
Copy link
Owner

It doesn't work with color bulbs yet. Mine are arriving soon and I will be adding support at that point

@npeskoe
Copy link
Author

npeskoe commented Mar 31, 2021

@JoshuaMulliken Thanks

@SecKatie SecKatie added Feature Request New feature or request and removed bug Something isn't working labels Mar 31, 2021
@SecKatie SecKatie changed the title WyzeApi authenticated but could not find any devices [Feature Request] Wyze Color Bulbs Mar 31, 2021
@ItsRhen
Copy link

ItsRhen commented Mar 31, 2021

I second! 🙂 Just got mine and this would be great. Thanks a lot.

@jscherry
Copy link

jscherry commented Apr 1, 2021

Mine will arrive soon. Looking forward to getting color bulbs working. Thanks for writing this code guys

@jscherry
Copy link

jscherry commented Apr 1, 2021

There’s a remote control car coming out tomorrow that works with a v2 camera connection

@SerpentDrago
Copy link

There’s a remote control car coming out tomorrow that works with a v2 camera connection

you should check the date .......

@SecKatie
Copy link
Owner

SecKatie commented Apr 2, 2021

There is a new beta out with support for the color bulbs. Please read the changelog before installing in case it breaks one of your use cases.

Please report any issues you find with the color bulb support

@jscherry
Copy link

jscherry commented Apr 2, 2021

Will the api for the color bulbs work with sensors and locks again soon? Just got my bulbs and would be glad to help any way I can. I'm a newb as far as burp goes but learn fast.

@SecKatie
Copy link
Owner

SecKatie commented Apr 3, 2021

@jscherry I do not think that I will be bringing locks or sensors back. Sensors are losing support from wyze fast some information on this reasoning can be found here. For the locks, I don't have them and the only functionality currently is the binary sensor, too much effort to continue to maintain.

@Mattie
Copy link

Mattie commented Apr 3, 2021

It did seem to work with the first color bulb I tried. The problem I had is just having a Wyze watch in the account seemed to break it such that I didn't get a working light? Maybe I just wasn't seeing it. But I removed my watch and now I see one of my bulbs for sure.

2021-04-03 11:28:01 ERROR (MainThread) [homeassistant.components.switch] Error while setting up wyzeapi platform for switch
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 200, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/wyzeapi/switch.py", line 40, in setup_platform
    if DeviceTypes(device.product_type) == DeviceTypes.PLUG:
  File "/usr/local/lib/python3.8/enum.py", line 339, in __call__
    return cls.__new__(cls, value)
  File "/usr/local/lib/python3.8/enum.py", line 662, in __new__
    raise ve_exc
ValueError: 'Wrist' is not a valid DeviceTypes
2021-04-03 11:28:01 ERROR (MainThread) [homeassistant.components.light] Error while setting up wyzeapi platform for light
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 200, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/wyzeapi/light.py", line 48, in setup_platform
    if DeviceTypes(device.product_type) == DeviceTypes.LIGHT:
  File "/usr/local/lib/python3.8/enum.py", line 339, in __call__
    return cls.__new__(cls, value)
  File "/usr/local/lib/python3.8/enum.py", line 662, in __new__
    raise ve_exc
ValueError: 'Wrist' is not a valid DeviceTypes

Though as I removed that from my Wyze account (don't use it much), my first bulb appeared just fine. Time to add more of them. :) Thanks so much for working on this!

@aasquith94
Copy link

With the new update the colors bulbs do not show but also my normal bulbs no longer show as well.

@aasquith94
Copy link

Error while setting up wyzeapi platform for light
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 200, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/wyzeapi/light.py", line 48, in setup_platform
if DeviceTypes(device.product_type) == DeviceTypes.LIGHT:
File "/usr/local/lib/python3.8/enum.py", line 339, in call
return cls.new(cls, value)
File "/usr/local/lib/python3.8/enum.py", line 662, in new
raise ve_exc
ValueError: 'BaseStation' is not a valid DeviceTypes

@SecKatie
Copy link
Owner

SecKatie commented Apr 4, 2021

Hey @aasquith94 can you update to the latest beta and let me know if it is working?

@aasquith94
Copy link

Same issue. Latest being Beta.4 correct? heres the logs incase theyre slightly different:

Logger: homeassistant.components.light
Source: custom_components/wyzeapi/light.py:48
Integration: Light (documentation, issues)
First occurred: 7:16:20 PM (1 occurrences)
Last logged: 7:16:20 PM

Error while setting up wyzeapi platform for light
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 200, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/wyzeapi/light.py", line 48, in setup_platform
if DeviceTypes(device.product_type) == DeviceTypes.LIGHT:
File "/usr/local/lib/python3.8/enum.py", line 339, in call
return cls.new(cls, value)
File "/usr/local/lib/python3.8/enum.py", line 662, in new
raise ve_exc
ValueError: 'BaseStation' is not a valid DeviceTypes

Logger: homeassistant.components.switch
Source: custom_components/wyzeapi/switch.py:40
Integration: Switch (documentation, issues)
First occurred: 7:16:20 PM (1 occurrences)
Last logged: 7:16:20 PM

Error while setting up wyzeapi platform for switch
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 200, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/wyzeapi/switch.py", line 40, in setup_platform
if DeviceTypes(device.product_type) == DeviceTypes.PLUG:
File "/usr/local/lib/python3.8/enum.py", line 339, in call
return cls.new(cls, value)
File "/usr/local/lib/python3.8/enum.py", line 662, in new
raise ve_exc
ValueError: 'BaseStation' is not a valid DeviceTypes

@SecKatie
Copy link
Owner

SecKatie commented Apr 4, 2021

Ok. Can you try beta.5?

@WBETHERI
Copy link

WBETHERI commented Apr 4, 2021

Mine will also not start -- looks like having the Wyze Scale on my account is bricking the DeviceTypes() check from wyzeapy.
I'd try and do a PR (just for an error handling stub so it doesn't brick-- I know there's a separate issue for scale support) but that repo's not public! Haha.

My trace:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 200, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/wyzeapi/light.py", line 48, in setup_platform
if DeviceTypes(device.product_type) == DeviceTypes.LIGHT:
File "/usr/local/lib/python3.8/enum.py", line 339, in call
return cls.new(cls, value)
File "/usr/local/lib/python3.8/enum.py", line 662, in new
raise ve_exc
ValueError: 'WyzeScale' is not a valid DeviceTypes

@SecKatie
Copy link
Owner

SecKatie commented Apr 5, 2021

Awesome. I have added WyzeScale!

New beta is available. I know that this is a painful process, but it is helping me build an understanding of all the different devices that exist in the ecosystem.

@aasquith94
Copy link

Beta 5 worked for me, thanks so much. ill update to beta 6 and test as well

@WBETHERI
Copy link

WBETHERI commented Apr 5, 2021

Beta 6 and the color bulbs work now (not getting hung up on WyzeScale).

@SecKatie
Copy link
Owner

SecKatie commented Apr 5, 2021

That is great! @aasquith94 @WBETHERI

Thank you for your help with testing!

@SecKatie SecKatie mentioned this issue Apr 6, 2021
@SecKatie SecKatie linked a pull request Apr 6, 2021 that will close this issue
@amitvaria
Copy link

amitvaria commented Apr 6, 2021

In my testing, I am having issues getting automation working. The scene is created, the lights brightness is set, but the rgb_color isn't set. I can change the color from developer tools

Here's the automation:

alias: DoorDashArriving
description: ''
trigger:
  - platform: event
    event_type: ifttt_webhook_received
    event_data:
      action: "doordash_arriving"
condition: []
action:
  - service: scene.create
    data:
      scene_id: dd_before
      snapshot_entities: 
        - light.amit_office_1
        - light.amit_office_2
        - light.amit_office_3
  - service: light.turn_on
    data:
      rgb_color:
        - 255
        - 0
        - 0
      brightness: 5
    target:
      entity_id:
        - light.amit_office_1
        - light.amit_office_2
        - light.amit_office_3
  - delay: 00:00:04
  - service: scene.turn_on
    data:
      entity_id: scene.dd_before

Here's the developer tools service:

service: light.turn_on
data:
  color_name: darkmagenta
target:
  entity_id:
    - light.amit_office_1
    - light.amit_office_2
    - light.amit_office_3

@drguitarum2005
Copy link

drguitarum2005 commented Apr 6, 2021

Beta 7 still having issues. What is the "common" device type? I have cameras, headphones, and color bulbs on my Wyze account.

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 200, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/wyzeapi/light.py", line 48, in setup_platform
if DeviceTypes(device.product_type) == DeviceTypes.LIGHT:
File "/usr/local/lib/python3.8/enum.py", line 339, in call
return cls.new(cls, value)
File "/usr/local/lib/python3.8/enum.py", line 662, in new
raise ve_exc
ValueError: 'Common' is not a valid DeviceTypes

@amitvaria
Copy link

amitvaria commented Apr 6, 2021

When I turn on debugging, I see that activating the scene is trying to set both brightness and hs_color:

2021-04-05 21:32:35 DEBUG (SyncWorker_10) [custom_components.wyzeapi.light] {'brightness': 1, 'hs_color': (33.333, 14.118)}
2021-04-05 21:32:35 DEBUG (SyncWorker_10) [custom_components.wyzeapi.light] Setting brightness

I think my issue comes from this. Preference is given to brightness and color is skipped.

@SecKatie
Copy link
Owner

SecKatie commented Apr 6, 2021

Ok, fixes for both of those issues is in beta 8.1.

Please let me know if it is working now. I working to get this release pulled into master as a new stable release.

@amitvaria
Copy link

Tested my issue and it's resolved. Thanks!

@SecKatie
Copy link
Owner

SecKatie commented Apr 6, 2021

Great!

@drguitarum2005
Copy link

My issue about 'common' is resolved and I have my 4 bulbs loaded in.

Another small bug: in Wyze app, you can group 2+ bulbs together and they all change colors together. I have 2 of mine paired that way. Through HA, neither one will change colors until I move the slider on BOTH entities.

@etchings13
Copy link

I am also getting an error trying to set these up:

Error while setting up wyzeapi platform for light
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 200, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/wyzeapi/light.py", line 48, in setup_platform
if DeviceTypes(device.product_type) == DeviceTypes.LIGHT:
File "/usr/local/lib/python3.8/enum.py", line 339, in call
return cls.new(cls, value)
File "/usr/local/lib/python3.8/enum.py", line 662, in new
raise ve_exc
ValueError: 'JA_RO2' is not a valid DeviceTypes

If it helps, the Devices I have in my account are the Wyze Vacuum, Wyze Doorbell, two Cam v2s and one Cam v3. That is in addition to the new 4-pack of color bulbs obviously.

@amitvaria
Copy link

amitvaria commented Apr 6, 2021

My issue about 'common' is resolved and I have my 4 bulbs loaded in.

Another small bug: in Wyze app, you can group 2+ bulbs together and they all change colors together. I have 2 of mine paired that way. Through HA, neither one will change colors until I move the slider on BOTH entities.

I'm not sure I understand exactly the issue you're seeing, but I manually created similar light_groups in HA like this:

light:
  - platform: group
    name: Amit Office Lights
    entities:
      - light.amit_office_1
      - light.amit_office_2
      - light.amit_office_3
  - platform: group
    name: Gym Lights
    entities:
      - light.gym_1
      - light.gym_2
      - light.gym_3

Then you can adjust the bulbs like you can in the Wyze app:
image

@mullethunter324
Copy link

Getting the following errors. I have removed my Wyze app bulb grouping to reduce complexity.

Switch:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 200, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/wyzeapi/switch.py", line 40, in setup_platform
if DeviceTypes(device.product_type) == DeviceTypes.PLUG:
File "/usr/local/lib/python3.8/enum.py", line 339, in call
return cls.new(cls, value)
File "/usr/local/lib/python3.8/enum.py", line 662, in new
raise ve_exc
ValueError: 'JA_RO2' is not a valid DeviceTypes

Light:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 200, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/wyzeapi/light.py", line 48, in setup_platform
if DeviceTypes(device.product_type) == DeviceTypes.LIGHT:
File "/usr/local/lib/python3.8/enum.py", line 339, in call
return cls.new(cls, value)
File "/usr/local/lib/python3.8/enum.py", line 662, in new
raise ve_exc
ValueError: 'JA_RO2' is not a valid DeviceTypes

@drguitarum2005
Copy link

My issue about 'common' is resolved and I have my 4 bulbs loaded in.
Another small bug: in Wyze app, you can group 2+ bulbs together and they all change colors together. I have 2 of mine paired that way. Through HA, neither one will change colors until I move the slider on BOTH entities.

I'm not sure I understand exactly the issue you're seeing, but I manually created similar light_groups in HA like this:

light:
  - platform: group
    name: Amit Office Lights
    entities:
      - light.amit_office_1
      - light.amit_office_2
      - light.amit_office_3
  - platform: group
    name: Gym Lights
    entities:
      - light.gym_1
      - light.gym_2
      - light.gym_3

Then you can adjust the bulbs like you can in the Wyze app:
image

Thats not a bad way to do it. I'll revert to that if I need to. The issue comes up if you do the grouping within the Wyze app, the grouping doesn't automatically load into HA so you try to adjust one light in HA but nothing responds until you've adjusted all the lights in that group in HA to the same settings.

@aasquith94
Copy link

My main issue is in scenes. If i select a color temp for the bulb for a normal non color light and run the scene it sets the bulb to the last selected color. so if the circle has purple selected for example, and in the scene i move the color temp slider to warm white and hit save its saving as purple.

@SecKatie
Copy link
Owner

SecKatie commented Apr 6, 2021

Working on adding "JA_RO2" as a recognized device

@SecKatie
Copy link
Owner

SecKatie commented Apr 6, 2021

@mullethunter324 can you test the latest beta.9?

@mullethunter324
Copy link

@mullethunter324 can you test the latest beta.9?

Looking good for me now. Switch and bulbs came in. No errors. Going to test with wyze app bulb grouping later.

@etchings13
Copy link

I am also getting an error trying to set these up:

Error while setting up wyzeapi platform for light
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 200, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/wyzeapi/light.py", line 48, in setup_platform
if DeviceTypes(device.product_type) == DeviceTypes.LIGHT:
File "/usr/local/lib/python3.8/enum.py", line 339, in call
return cls.new(cls, value)
File "/usr/local/lib/python3.8/enum.py", line 662, in new
raise ve_exc
ValueError: 'JA_RO2' is not a valid DeviceTypes

If it helps, the Devices I have in my account are the Wyze Vacuum, Wyze Doorbell, two Cam v2s and one Cam v3. That is in addition to the new 4-pack of color bulbs obviously.

beta.9 seems to have fixed the issue for me!

@drguitarum2005
Copy link

If I accidentally do a couple of rapid state changes (off and on), the switch and icon get out of sync and it’ll update after maybe 15 seconds (HA says light is off but it’s really on). Does that have anything to do with this integration?

@SecKatie
Copy link
Owner

SecKatie commented Apr 7, 2021

The Wyze service does not reflect the valid state of the device immediately. It takes about 15 seconds for it to be correct.

@tggman
Copy link

tggman commented Apr 7, 2021

Just added two color bulbs via the Wyze app, updated HAC to 2021.4 and switched to HA-WyzeAPI to 2021.4-beta.10.1.

Unfortunately 2021.4-beta.10.1 is not working for me. From the error log:

Logger: homeassistant.components.light
Source: custom_components/wyzeapi/light.py:48
Integration: Light (documentation, issues)
First occurred: 4:44:48 PM (1 occurrences)
Last logged: 4:44:48 PM

Error while setting up wyzeapi platform for light
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 205, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/wyzeapi/light.py", line 48, in setup_platform
if DeviceTypes(device.product_type) == DeviceTypes.LIGHT:
File "/usr/local/lib/python3.8/enum.py", line 339, in call
return cls.new(cls, value)
File "/usr/local/lib/python3.8/enum.py", line 662, in new
raise ve_exc
ValueError: 'JA.SC' is not a valid DeviceTypes

Switching back to the stable release brings my non-color lights back.
Devices in my account:
(1) Wyze Doorbell
(1) Wyze Vacuum
(1) Scale
(1) Cam Pan
(2) Cam v3
(2) Color bulbs
(7) white bulbs
(1) Wyze Headphone

SecKatie pushed a commit to SecKatie/wyzeapy that referenced this issue Apr 8, 2021
See: SecKatie/ha-wyzeapi#126 (comment)

Why: In order to fix a crash where headphones were not recognized as a valid device type

How: Add headphones to the DeviceTypes enum in base_client.py
SecKatie pushed a commit to SecKatie/wyzeapy that referenced this issue Sep 25, 2021
…zeapi#126 (comment): In order to fix a crash where headphones were not recognized as a valid device typeHow: Add headphones to the DeviceTypes enum in base_client.py
SecKatie pushed a commit to SecKatie/wyzeapy that referenced this issue Sep 26, 2021
See: SecKatie/ha-wyzeapi#126 (comment)

Why: In order to fix a crash where headphones were not recognized as a valid device type

How: Add headphones to the DeviceTypes enum in base_client.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.