SecKatie / ha-wyzeapi

Home Assistant Integration for Wyze devices.
751 stars 113 forks source link

Add more cameras with batteries #455

Closed magikid closed 1 year ago

magikid commented 1 year ago

I discovered that two of my models can show their battery levels. This enables that functionality for them.

Fixes #454

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

magikid commented 1 year ago

I've confirmed this resolves the issue locally by modifying the library, restarting home assistant, and checking the entities show up with batteries now:

image

JoeSchubert commented 1 year ago

LGTM. However, from what I've seen... Even on wired power, the doorbell reports a battery percentage. So, this will show that battery percentage even with a wired doorbell. I am unsure exactly what indicates that it is on wired power unless it is the blank string for "battery_charging_status": "",

as that is how mine appears being wired.

I think it's worth including either way. However, I expect that we will get issues of "my wired doorbell is reporting battery percentages"

magikid commented 1 year ago

I don’t have the ability to hardwire mine. Could it be keeping the batteries topped off?

Could you give me an example of the json response for your hardwired one so I can compare them? I wouldn’t mind reworking this a little to only add the doorbell if it’s actually using batteries.

JoeSchubert commented 1 year ago

Could you give me an example of the json response for your hardwired one so I can compare them?

This is the response from mine I pulled a couple weeks back. I don't know that it "keeps the batteries topped off" per se. The app doesn't report battery levels if it's on wired power. Like I said, I'm willing to bet that it's the value in one of these two keys that is different than yours, being on battery vs wired.

device_params > battery_charging_status device_params > power_switch

{ "binding_ts": 1667599768000, "binding_user_nickname": "email@email.com", //Modified to protect privacy, but this is the email address of the user who added the device "conn_state": 1, "conn_state_ts": 1671346891000, "device_params": { "accessory_switch": 0, "ai_notification_v2": 0, "audio_alarm_switch": 1, "battery_charging_status": "", "camera_thumbnails": { "thumbnails_ts": 1671590089648, "thumbnails_url": "url-to-thumbnails" //Modified to protect privacy, but this is url to thumbnails }, "co_alarm_switch": 1, "comfort_standard_level": 2, "device_setting_channel": 0, "dongle_product_model": "", "dongle_switch": 0, "dtls": 0, "electricity": "84", "humidity": "0", "ip": "", "is_link_toy_car": 0, "is_temperature_humidity": "0", "main_device_dtls": 0, "motion_alarm_switch": 1, "p2p_id": "GW_BE1_MAC", //Modified to protect privacy, but this is the model combined with the MAC address "p2p_type": 0, "power_saving_mode_switch": 0, "power_switch": 1, "public_ip": "", "records_event_switch": 1, "smoke_alarm_switch": 1, "ssid": "", "temp_humi_room_type": 1, "temperature": "0" }, "enr": "", "event_master_switch": 1, "firmware_ver": "0x2a26", "first_activation_ts": 1667599768000, "first_binding_ts": 1667599768000, "hardware_ver": "0.0.0.0", "is_in_auto": 0, "mac": "GW_BE1_MAC", //Modified to protect privacy, but this is the model combined with the MAC address "nickname": "Front door", "parent_device_enr": "", "parent_device_mac": "", "product_model": "GW_BE1", "product_model_logo_url": "", "product_type": "Camera", "push_switch": 1, "timezone_gmt_offset": -5.0, "timezone_name": "America/New_York", "user_role": 1 },

JoeSchubert commented 1 year ago

@magikid were you able to determine the field that indicates that your doorbell is on battery?

magikid commented 1 year ago

No luck. That battery charging status field doesn't look like a good indication either because my battery doorbell is showing an empty field for it.

JoeSchubert commented 1 year ago

No luck. That battery charging status field doesn't look like a good indication either because my battery doorbell is showing an empty field for it.

What's your response look like? With the couple sensitive fields edited out like in mine.

SecKatie commented 1 year ago

It seems like this feature is still in progress. @magikid can you work with @JoeSchubert to get this feature ready for addition?

github-actions[bot] commented 1 year ago

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

github-actions[bot] commented 1 year ago

This PR was closed because it has been stalled for 10 days with no activity.