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

Fixed and added entity toggles #607

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KyGuy2002
Copy link

I tested and fixed many of the control entities in this integration. I also added some that were unavailable and removed some that are not applicable to the device they are on.

Note: These changes depend on changes made in SecKatie/wyzeapy#91

Note: I squashed all my commits into one. This is the first major HA contribution I made so I wanted to clean up all the commits where I was troubleshooting the HACS integration installation stuff.

Changes

  • Implemented Battery Cam Pro Spotlight
  • Fixed Battery Cam Pro Notification Toggle
  • Fixed Battery Cam Pro Event Recording (Motion) Toggle
  • Fixed Battery Cam Pro Power
  • Fixed Battery Cam Pro Siren
  • Fixed Floodlight Pro Floodlight
  • Fixed Floodlight Pro Notification Toggle
  • Fixed Floodlight Pro Event Recording (Motion) Toggle
  • Fixed Floodlight Pro Power
  • Fixed Floodlight Pro Siren
  • Removed Motion Detection Toggle from Video Doorbell Pro (Didn’t work, can’t fix)
  • Removed Power Toggle from Video Doorbell Pro (Device does not have that function)
  • Removed Siren Toggle from Video Doorbell Pro (Device does not have that function)
  • Fixed OG Cam Notification Toggle
  • Fixed OG Cam Event Recording (Motion) Toggle
  • Fixed OG Cam Power
  • Fixed OG Cam Siren
  • Implemented V4 Cam Lamp Socket Accessory (Didn’t test with v3, but should work)
  • Removed Floodlight Toggle fromV3 Cams without Floodlight Accessory
  • Fixed Wyze Cam Outdoor Notification Toggle
  • Fixed Wyze Cam Outdoor Event Recording (Motion) Toggle
  • Fixed Wyze Cam Outdoor Power
  • Fixed Wyze Cam Outdoor Siren

Not Working (Proprietary/Tutk Communication Protocol)

  • V4 Cam Internal Spotlight
  • V3 Pro Cam Internal Spotlight
  • OG Cam Internal Spotlight

Could Not Get Working/Needs Testing

  • Video Doorbell Pro Notification Toggle unavailable
    • I can confirm the API works, but the toggle appears grayed out in HA. The device.available attribute is False in HA. Suggestions?
  • V3 Cam Lamp Socket Toggle
    • Don’t have one setup to test.
  • Video Doorbell Pro Motion Toggle
    • Request does not appear in proxy… Not sure what i'm missing.
  • OG Cam siren is stateless
    • Not sure the names of the properties for the OG cam. The app makes a request to get iot props for the other devices using the devicemgmt api (FLP, BCP), so I can see the list of possible properties, but the OG does not do this. Other notification and motion detection properties are the same, but siren returns None.
  • Some toggles revert their state after toggling, causing a desync between the device and HA.

@carverofchoice
Copy link

I can't tell you how excited I am to get some of these changes added!!!!! The floodlight pro updates are something I've been dying for since Wyze launched them. THANK YOU KyGuy2002 for figuring these out! This is EXTREMELY appreciated! I hope we get a new update with these in them soon!

@brg468
Copy link
Collaborator

brg468 commented Jun 15, 2024

@KyGuy2002 this is awesome, thank you for all this work! I’ll take a look and test the devices that I have soon.

@KyGuy2002
Copy link
Author

Thanks both of you! I am happy to help out :D

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not directly related to this PR, but I'm going to recommend that we remove this while we're at it. The global notification toggle is broken, unless you can find out what Wyze is doing to make this work in the app I think its better to just remove entirely. The whole class can probably be removed if we decide its not fixable.

switches.append(WyzeNotifications(client))

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not entirely sure what this toggle did. Is it similar to the snooze functionality in the app? (Home tab)

Copy link
Collaborator

@brg468 brg468 Jun 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea it used to be a simple on/off for global notifications from the app. They have since changed it to a menu of turn off for various amounts of time or until turned back on. But I couldn't figure out how they were setting those values, and even the param we were polling for the status of that switch is no longer correct.

Copy link
Author

@KyGuy2002 KyGuy2002 Jun 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like they use https://beta-platform-service.wyzecam.com/app/v2/platform/set_message_setting with a payload of:

{
    "is_enabled_notification": false,
    "nonce": "1718913567551",
    "off_until_timestamp": 0
}

To turn off and on. I will look at how state is checked.

Should I create a new PR on wyzeapy or add to the one I already have over there?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok cool. It's probably fine to add to the one you have open already, just add it to the notes you have in the description.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. Shouldn't require any changes on the ha side, but I will let you know when that commit has been made.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strangely, the wyze server is not accepting the signature2 value. I have tried it using the ford and olive signature creation methods with no luck.

Maybe the beta-platform-service.wyzecam.com server uses a diffrent signature scheme? How were you able to find how the other 2 were created, did you have to decompile the app? I haven't done that yet.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m not sure, I wasn’t around for that. Maybe @SecKatie can shed some light on that part.

@mikefrantz
Copy link

I can toggle the Wyze notifications in the Home Assistant app and it does not turn on the alarm notifications in the Wyze app. I can do a reverse way turning the Wyze notifications on or off in the Wyze app and it does not affect the way the toggle is in the Home Assistant app either, I cannot automatically toggle the Wyze notifications through Home Assistant since about March or April.

@terryhonn
Copy link

I'm not a developer and am relatively git-ignorant.... is there a way that I can use the changes in this PR and it's dependent so that I can take advantage of these additional functions? I've got a few of the Floodlight v2 cams and would really like to be able to control the lights from HA. Thanks!

@KyGuy2002
Copy link
Author

I'm not a developer and am relatively git-ignorant.... is there a way that I can use the changes in this PR and it's dependent so that I can take advantage of these additional functions? I've got a few of the Floodlight v2 cams and would really like to be able to control the lights from HA. Thanks!

Unfortunately it's not super simple to do so. You would need to fork this repo, make some changes to directly reference the updated commits in the dependent library, and then uninstall the current wyze integration and add this one, which may cause you to loose your devices config (not sure).

I think these PRs should be merged so users can take advantage of all the changes, and we can work on the other issues mentioned here without holding up these changes.

@terryhonn
Copy link

I'm not a developer and am relatively git-ignorant.... is there a way that I can use the changes in this PR and it's dependent so that I can take advantage of these additional functions? I've got a few of the Floodlight v2 cams and would really like to be able to control the lights from HA. Thanks!

Unfortunately it's not super simple to do so. You would need to fork this repo, make some changes to directly reference the updated commits in the dependent library, and then uninstall the current wyze integration and add this one, which may cause you to loose your devices config (not sure).

I think these PRs should be merged so users can take advantage of all the changes, and we can work on the other issues mentioned here without holding up these changes.

Thanks for the quick response! I was able to copy the changes in the changed files in this PR and update those files in the HA custom_components/wyzeapi folder, but when I tried to do the same with the changed files in 91, I found that I couldn't locate those files in my installation.

I've managed also to fork this repo, so if there are steps outlined somewhere on how to make those changes to directly reference the updated commits in 91, I could give that a shot.

Thanks again for your responsiveness!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for Wyze OG Camera
5 participants