wyze-sdk icon indicating copy to clipboard operation
wyze-sdk copied to clipboard

Support for Wyze Switch

Open TheGreatSkeeve opened this issue 3 years ago • 6 comments

New product - https://wyze.com/wyze-light-switch.html

Is this already supported, and does it plan to be supported?

Thanks!

TheGreatSkeeve avatar Feb 19 '22 01:02 TheGreatSkeeve

Hey @TheGreatSkeeve,

This would be an awesome addition. Hopefully it's pretty similar to the plug. I'd be happy to give this a go if you either a) want to send me a switch or b) don't mind sharing yours with my account for a little while so I can see how it's implemented.

Let me know. If it's easier to email, I'm shaun tarves net

shauntarves avatar May 01 '22 15:05 shauntarves

Hey @shauntarves

If @TheGreatSkeeve hasn't been able to share a switch to you for testing, I'm more than happy to! Please let me know which account to share it to.

I'd love to be able to control the Wyze Switch via this SDK!

JGirard8 avatar Jun 02 '22 16:06 JGirard8

@JGirard8 It's the same email he provided in his response. I did share it, but the share is listed as pending. Might not hurt to share yours!

TheGreatSkeeve avatar Jun 02 '22 16:06 TheGreatSkeeve

@shauntarves I shared to [email protected]! I'm willing to send a physical switch to you if absolutely necessary too, just let me know. Thanks!

JGirard8 avatar Jun 02 '22 16:06 JGirard8

OHHH, this is awesome. Thank you.

Not sure why skeeve's sharing didn't work out correctly, but I appreciate the follow up.

On Thu, Jun 2, 2022 at 12:55 PM JGirard8 @.***> wrote:

@shauntarves https://github.com/shauntarves I shared to @.***! I'm willing to send a physical switch to you if absolutely necessary too, just let me know. Thanks!

— Reply to this email directly, view it on GitHub https://github.com/shauntarves/wyze-sdk/issues/66#issuecomment-1145091037, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEDBMETNK6QL35NSS2R6ULVNDRRVANCNFSM5OZUAP4Q . You are receiving this because you were mentioned.Message ID: @.***>

shauntarves avatar Jun 02 '22 17:06 shauntarves

Dude, I think something got buggered on my end. I kid you not, I got three pop ups stating I'd shared stuff with you every time I opened the app - for like three weeks.

TheGreatSkeeve avatar Jun 02 '22 17:06 TheGreatSkeeve

Hey guys, finally picking back up on this. I can still see @JGirard8 's switch, but only for limited actions (can't see schedule-related stuff).

I should be able to get some basic support in shortly. Thanks for everyone's patience.

shauntarves avatar Sep 28 '22 17:09 shauntarves

@TheGreatSkeeve @JGirard8

Hey all...I finally pushed up some support for the Switch on https://github.com/shauntarves/wyze-sdk/tree/66-support-for-wyze-switch. As I mentioned, I have very limited access on @JGirard8's Switch, so I can't model some of the more advanced features yet, but basic controls are there.

Some commands shown down below if you want to try it out. If there's any other functionality you want supported, let me know and we can figure something out.

did = 'LD_SS1_XXXX'
model = 'LD_SS1'

switch = client.switches.info(device_mac=did)
print(f"power: {switch.is_on}")
print(f"away mode: {switch.away_mode.value}")
if switch.timer_actions is not None:
    print(f"timer actions: {switch.timer_actions}")

print("Turning switch on...")
client.switches.turn_on(device_mac=did, device_model=model)
switch = client.switches.info(device_mac=did)
print(f"is on: {switch.is_on}")

print("Turning switch off...")
client.switches.turn_off(device_mac=did, device_model=model)
switch = client.switches.info(device_mac=did)
print(f"is on: {switch.is_on}")

print("Activating away mode...")
client.switches.set_away_mode(device_mac=did, device_model=model)
switch = client.switches.info(device_mac=did)
print(f"away mode: {switch.away_mode.value}")

print("Deactivating away mode...")
client.switches.set_away_mode(device_mac=did, device_model=model, away_mode=False)
switch = client.switches.info(device_mac=did)
print(f"away mode: {switch.away_mode.value}")

print("Turning switch off after 3 hours...")
client.switches.turn_on(device_mac=did, device_model=model)
client.switches.turn_off(device_mac=did, device_model=model, after=timedelta(hours=3))
client.switches.clear_timer(device_mac=did, device_model=model)

print("Turning switch on after 3 hours...")
client.switches.turn_off(device_mac=did, device_model=model)
client.switches.turn_on(device_mac=did, device_model=model, after=timedelta(hours=3))
client.switches.clear_timer(device_mac=did, device_model=model)

shauntarves avatar Nov 07 '22 22:11 shauntarves

@TheGreatSkeeve @JGirard8 Last call for some testing on this, otherwise, I'll merge it to master tomorrow and create a new release.

shauntarves avatar Nov 29 '22 13:11 shauntarves