ha-wyzeapi icon indicating copy to clipboard operation
ha-wyzeapi copied to clipboard

[Bug] Scene.create not working with Wyze bulbs

Open drguitarum2005 opened this issue 3 years ago • 13 comments

Is there any reason to believe this integration would make the light entities act any different than other bulbs? I'm using a scene.create in a script to snapshot initial state before changing colors and brightness and then reverting to that initial scene. The scene.create doesn't seem to be writing anything. This exact code works fine with my Singled color bulbs. Thoughts?

sequence:
  - service: scene.create
    data:
      scene_id: entry_before
      snapshot_entities: light.entry_lamp
  - service: light.turn_on
    data:
      color_name: red
      flash: long
      brightness_pct: 25
    target:
      entity_id: light.entry_lamp
  - delay:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 500
  - service: light.turn_on
    data:
      color_name: red
      brightness_pct: 25
      flash: long
    target:
      entity_id: light.entry_lamp
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - service: scene.turn_on
    target:
      entity_id: scene.entry_before
mode: single
alias: Flash Entry Light Red

drguitarum2005 avatar Sep 22 '21 15:09 drguitarum2005

Just speculation, since I don't have bulbs...

But I would suspect that it's related to the turn_on property being not implemented.

https://github.com/JoshuaMulliken/ha-wyzeapi/blob/525fd22866899539aee27e6d65ae649cd4c10bd5/custom_components/wyzeapi/light.py#L75

I think you may have to call async_turn_on as the service.

Thanks for the input. Do you mean call async_turn_on as the service instead of scene.turn_on? If so, I'm not sure that'll solve the problem of the scene not being created?

drguitarum2005 avatar Sep 28 '21 16:09 drguitarum2005

Were you able to figure this out? Or have any extra info?

JoeSchubert avatar Oct 30 '21 00:10 JoeSchubert

my issue may be related, but I can't control brightness on my bulbs either, so maybe related? only on/off

bobloadmire avatar Nov 14 '21 18:11 bobloadmire

I have this exact issue, in fact I'm going to close my issue I just posted.. derp.

danielzrob avatar Dec 06 '21 05:12 danielzrob

@danielzrob @bobloadmire @drguitarum2005 can someone test the latest beta and see if it is working for you? I made some changes that might fix this.

SecKatie avatar Dec 11 '21 18:12 SecKatie

@danielzrob @bobloadmire @drguitarum2005 can someone test the latest beta and see if it is working for you? I made some changes that might fix this.

No dice. Updated to the latest beta listed and tried a brand new script (same structure). It turns the light red but then it just stays red forever.

sequence:
  - service: scene.create
    data:
      scene_id: entry_before
      snapshot_entities: light.entry_lamp
  - service: light.turn_on
    data:
      color_name: red
    target:
      entity_id: light.entry_lamp
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - scene: scene.entry_before
mode: single

drguitarum2005 avatar Dec 11 '21 18:12 drguitarum2005

I gave it a shot too, no joy.

danielzrob avatar Dec 12 '21 07:12 danielzrob

Ok, I made a new change that seems to make my scenes in the UI more reliable. Sorry to keep asking yall to test, but I greatly appreciate the help in resolving this.

SecKatie avatar Dec 12 '21 17:12 SecKatie

Ok, I made a new change that seems to make my scenes in the UI more reliable. Sorry to keep asking yall to test, but I greatly appreciate the help in resolving this.

Unfortunately no dice.

drguitarum2005 avatar Dec 12 '21 17:12 drguitarum2005

Just curious... I don't have bulbs to test with, or I'd do it.

Has anyone changed their Home Assistant's logging to debug (globally, not just for this integration) and tried this to see what the logs show? I know it's going to be A LOT of log output, but grepping for "scene" I would imagine should get you in the ballpark of the relevant part, if you don't have a ton of scenes firing.

Edit: Technically, as long as you have something in a logging block in your config you can call the logger service before and after testing to minimize the extra noise as well.

service: logger.set_default_level data: level: debug

Then do the same thing back to warning or error.

JoeSchubert avatar Dec 15 '21 02:12 JoeSchubert

Same here no ability for scenes

gdreelin avatar Feb 08 '22 19:02 gdreelin

sequence:

  • service: scene.create data: scene_id: entry_before snapshot_entities: light.entry_lamp
  • service: light.turn_on data: color_name: red target: entity_id: light.entry_lamp
  • delay: hours: 0 minutes: 0 seconds: 5 milliseconds: 0
  • scene: scene.entry_before mode: single

I just tried this exact script with a bulb and a light strip and it seemed to work as expected: two different starting colors, both went red for 5 seconds then back to the original colors.

Occasionally the color shown in the frontend went back to red for a bit (until the next update cycle) but the light itself was the correct color. Maybe something in the recent updates fixed it?

brg468 avatar Feb 17 '22 15:02 brg468

Maybe something in the recent updates fixed it?

I would guess maybe this fixed it wherever it got merged in?

https://github.com/JoshuaMulliken/ha-wyzeapi/commit/618210c4b5d50a8148b2b9c864c970129314f1bc

JoeSchubert avatar Feb 21 '22 18:02 JoeSchubert

Closing as stale.

Please reopen if this is still ongoing.

JoeSchubert avatar Jan 07 '23 16:01 JoeSchubert