Any interest in a Pytomation Wyze Interface?

32 views
Skip to first unread message

Anthony Stabile

unread,
Aug 7, 2021, 1:49:03 AM8/7/21
to pytomation
I recently migrated from a legacy MisterHouse system to Pytomation.  This is my first post to the group.  

Thank you all for your past contributions toward this great project!

I have created a Wyze interface based upon Wyze-sdk by using the Philips Hue interface as a template.    Note that not all Wyze devices are supported and Wyze-sdk is reverse-engineered and thus could break at any time.

Please respond if anyone has interest in my source for this interface.

Cheers!

George Farris

unread,
Aug 7, 2021, 9:13:50 PM8/7/21
to pytom...@googlegroups.com
I don't use any Wyze stuff but any additions are welcome.

Cheers
George
--
You received this message because you are subscribed to the Google Groups "pytomation" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pytomation+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pytomation/0da8f216-f112-4c68-96b3-1391017b78f0n%40googlegroups.com.

Jason Sharpee

unread,
Aug 7, 2021, 9:37:42 PM8/7/21
to pytom...@googlegroups.com
Me either, but if you would like contributor access to merge just let me know!

-J


Anthony Stabile

unread,
Aug 8, 2021, 1:17:42 PM8/8/21
to pytomation
Jason,

Yes access would be great, thank you.  I would be happy to merge once I am code complete and peer reviewed.  

Thank you for the prompt response.  While I have both of your attention, I have a question regarding accessing the device type from within an interface.   

The Wyze-sdk has different API's for lights versus plugs.   The interface needs access to the device type to determine which API to utilize. 

I have a working, but cumbersome solution included below.   Is there an easier way to reference the object's device type?  

Thank you,

Tony

<excerpt from within Interface wyze.py>

# Iterate through the instance list.
# Strip off any digits in the device type and save
# If the address matches, assign device_type

device_type = "UNKNOWN"
item_type = ""
next_object = False
for item in self.instances.items():
    for element in item:
        # Compare address to pytomation object
        if next_object:
            # Address not available on all objects
            try:
                if str(element.address) == address:
                    device_type = item_type
            except:
                pass
            # Next pass will be device label
            next_object = False
        # Save device type stripped of any digits.
        else:
            import re
            item_type = re.sub('\d', '', str(element))
            # Next pass will be a pytomation object
            next_object = True

George Farris

unread,
Aug 8, 2021, 10:23:47 PM8/8/21
to pytom...@googlegroups.com
Remember this repo is 190 comits ahead of Jasons.

So might want to consider that.

Cheers
George

Anthony Stabile

unread,
Aug 9, 2021, 12:21:31 AM8/9/21
to pytom...@googlegroups.com
George,

Thank you for the reminder.  I had wondered about the multiple Pytomation repositories.  

I have been basing my local development off of:  https://github.com/king-dopey/pytomation 

Thanks,

Tony

From: pytom...@googlegroups.com <pytom...@googlegroups.com> on behalf of George Farris <farr...@gmail.com>
Sent: Sunday, August 8, 2021 10:23 PM
To: pytom...@googlegroups.com <pytom...@googlegroups.com>
Subject: Re: [pytomation] Any interest in a Pytomation Wyze Interface?
 

David

unread,
Aug 9, 2021, 1:35:49 AM8/9/21
to pytomation
It's the same old story. I had some free-time, so I started coding. Jason became busy and the difference between the repos became large... And since then, I've become rather busy. I still make a commit here and there, but I don't have the time I used to.

In an effort to not repeat history, I sent you a request for to become a contributor to the king-dopey/pytomation repo, but I also see Jason gave you access to his repo as well. Whichever becomes the main, we should just be sure to update the documentation at pytomation.com. (there are no rivalries here, no ones feeling will get hurt, either way)

To your question, that looks very interface specific. While working the insteon and openzwave interfaces, the device time is not stored in the address. With OpenZwave, it was easy, just run commands in sequence, until you get the correct one. For the Insteon Hub, I did need extra details from the device, so I grabbed the device object. For you case, you can probably grab the class type of the device (light, lock, etc).

I do different things, but this is an example of how to get that device, starting on line 154 in Insteon_hub.py.
elif self._devices:
            for d in self._devices:
                if d.address.upper() == address:

Anthony Stabile

unread,
Aug 13, 2021, 2:18:12 AM8/13/21
to pytomation
David,

Thank you for contributor access and for the suggested script snippet on devices.   It is the quick solution I was looking for!

I am working with the wyze-sdk developer on some additional features.   Once the interface is stable, I will share with the group for review. 

Until then, if anyone with Wyze gear has interest in my development version please reach out.  I also have created working interfaces for Lutron Caséta and MQTT.  

Regards,

Tony
Reply all
Reply to author
Forward
0 new messages