-
Notifications
You must be signed in to change notification settings - Fork 123
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
Camera battery_level no longer reflects voltage #865
Comments
Oddly:
During my cron job executions, I don't normally collect the raw JSON for debugging purposes, so I don't have any additional details, unfortunately. I'm not sure what to make of this but perhaps one of these theories has merit:
|
I suppose you could try capturing the json data, to see what is different. It can't hurt having more data :) IF the If we can isolate what exactly your receiving, we can handle it. |
makes sense! The JSON for the "all zero voltages" is shown in the original post, and it has "battery" under "signals", but the numbers shown there are "2" or "3" (which have no obvious meaning), as opposed to the old battery_level values in the range of 130-170 (to reflect 1.30v to 1.70 volts). That said, I'll modify my container so that I capture the raw JSON so in case the battery voltages come back, we can see what the JSON looks like. |
Update after spending some time with this. Please recall above when I mentioned I had 3 cron jobs, at: 11pm, 1159pm, and 2am, and that only the 1159pm job reported the voltage correctly. After looking closer, I discovered/remembered that my 1159pm job is using a docker image with blinkpy v.022 (and properly shows the voltages), while the other jobs are using v0.22.5 and do NOT show the voltage. This means that the voltage breakage is NOT BECAUSE OF BLINK, but rather, because code has broken in blinkpy between v0.22 and v0.22.5. So I began to focus on the changes that occurred in the blinkpy code between v0.22 and v0.22.5. I narrowed it down to a discussion in #821 and possibly a logic change in #813, released in v0.22.4. This is in the context of Bottom line: BECAUSE of the change to Because of this short-circuit return, the call to For my part, I put the following code together:
And ran it against v0.22:
And also ran it against v0.22.5:
Finally, I had to add debugging lines to v0.22 but the camera information available in v0.22 is: {
"camera": [
{
"id": 1193164,
"created_at": "2023-07-21T03:15:07+00:00",
"updated_at": "2024-01-30T00:16:00+00:00",
"deleted_at": "",
"serial": "120873405",
"camera_key": "",
"camera_key_type": "AES128_CBC",
"fw_version": "2.151",
"mac_address": "f4:b8:5e:34:61:bd",
"ip_address": "",
"thumbnail": "1705786681",
"name": "CB-Workshop",
"liveview_enabled": "off",
"siren_enable": false,
"siren_volume": "",
"onboarded": true,
"unit_number": 1,
"motion_sensitivity": 8,
"enabled": true,
"armed": false,
"alert_tone_enable": false,
"alert_tone_volume": 0,
"alert_repeat": "off",
"alert_interval": 10,
"video_length": 60,
"temp_alarm_enable": false,
"temp_interval": 1,
"temp_adjust": 0,
"temp_min": "",
"temp_max": "",
"temp_hysteresis": "",
"illuminator_enable": 2,
"illuminator_duration": 1,
"illuminator_intensity": 7,
"battery_alarm_enable": false,
"battery_voltage_interval": 0,
"battery_voltage_threshold": 512,
"battery_voltage_hysteresis": 512,
"last_battery_alert": "",
"battery_alert_count": 0,
"lfr_sync_interval": 8,
"video_50_60hz": "freq_60hz",
"invert_image": false,
"flip_image": false,
"record_audio_enable": true,
"clip_rate": 2480,
"liveview_rate": 0,
"max_resolution": "r1080",
"auto_test": false,
"wifi_timeout": 30,
"retry_count": 0,
"status": "done",
"wifi_strength": -27,
"lfr_strength": -43,
"temperature": 55,
"battery_voltage": 171,
"a1": false,
"last_temp_alert": "",
"temp_alert_count": 0,
"last_wifi_alert": "",
"wifi_alert_count": 0,
"last_lfr_alert": "",
"lfr_alert_count": 0,
"last_offline_alert": "",
"offline_alert_count": 0,
"temp_alert_state": "in_range",
"battery_state": "ok",
"battery_check_time": "2024-01-30T00:16:00+00:00",
"last_snapshot_event": "",
"motion_regions": 33554431,
"mfg_main_type": "BMA",
"mfg_main_range": 1811024665,
"mfg_mez_type": "BTA",
"mfg_mez_range": 1811059815,
"type": "white",
"ring_device_id": "",
"first_boot": "2019-06-29T01:37:36+00:00",
"country_id": "US",
"usage_alert_count": 0,
"last_usage_alert": "",
"snooze_till": "",
"network_type": "wifi",
"vo9_strength": 0,
"local_connection_certificate_id": "",
"account_id": __REDACTED__,
"network_id": 157629,
"sync_module_id": 288984,
"account": __REDACTED__,
"network": 157629,
"camera_seq": 1,
"last_connect": {
"camera_id": 1193164,
"created_at": "2023-07-21T03:15:22+00:00",
"updated_at": "2024-01-26T09:31:57+00:00",
"wifi_strength": -38,
"lfr_strength": -40,
"battery_voltage": 171,
"temperature": 60,
"fw_version": "2.151",
"fw_git_hash": "",
"mac": "f4:b8:5e:34:61:bd",
"ipv": "ipv4",
"ip_address": "192.168.1.21",
"error_codes": 0,
"battery_alert_status": false,
"temp_alert_status": false,
"ac_power": true,
"light_sensor_ch0": 0,
"light_sensor_ch1": 171,
"light_sensor_data_valid": false,
"light_sensor_data_new": false,
"time_first_video": 0,
"time_108_boot": 54536,
"time_wlan_connect": 1140574,
"time_dhcp_lease": 5031692,
"time_dns_resolve": 0,
"lfr_108_wakeups": 2,
"total_108_wakeups": 3,
"lfr_tb_wakeups": 65282,
"total_tb_wakeups": 8707,
"wifi_connect_failure_count": 0,
"dhcp_failure_count": 0,
"socket_failure_count": 0,
"dev_1": 5034489,
"dev_2": 26624,
"dev_3": 120873405,
"dev_4": "",
"dev_5": "",
"dev_6": "",
"dev_7": "",
"dev_8": "",
"unit_number": 1,
"serial": "120873405",
"lifetime_count": 0,
"lifetime_duration": 0,
"pir_rejections": 0,
"bl1_major": 0,
"bl1_minor": 0,
"bl1_build": 0,
"bl2_major": 0,
"bl2_minor": 0,
"bl2_build": 0,
"slot_0": 0,
"slot_1": 0,
"slot_2": 0,
"slot_3": 0,
"dev_keyed_unit": false,
"network_type": "wifi",
"vo9_strength": "",
"sync_module_id": 288984,
"network_id": 157629,
"account_id": __REDACTED__
},
"motion_alert": true,
"record_audio": true,
"buzzer_on": false,
"early_termination": false,
"clip_bitrate": 2480,
"liveview_bitrate": 0,
"motion_regions_compatible": true,
"early_pir_compatible": false,
"early_notification_compatible": false,
"night_vision_exposure_compatible": false,
"privacy_zones_compatible": false,
"zone_version": "v1",
"video_quality_support": [
"saver",
"standard",
"best"
],
"video_quality": "best",
"early_notification": false,
"night_vision_exposure": 1,
"local_storage_compatible": false,
"local_storage_enabled": false,
"clip_max_length": 60,
"early_termination_supported": true,
"clip_warning_threshold": 15,
"flip_video_compatible": false,
"flip_video": false,
"video_recording_enable": true,
"video_recording_optional": false,
"snapshot_compatible": false,
"snapshot_enabled": false,
"snapshot_period_minutes_options": [
60
],
"snapshot_period_minutes": 60
}
],
"signals": {
"lfr": 5,
"wifi": 5,
"updated_at": "2024-01-26T09:31:57+00:00",
"temp": 55,
"battery": 3,
"battery_state": "ok"
}
} while the camera information available in v0.22.5 is only: {
"id": 1193164,
"created_at": "2023-07-21T03:15:07+00:00",
"updated_at": "2024-01-30T00:16:00+00:00",
"name": "CB-Workshop",
"serial": "120873405",
"fw_version": "2.151",
"type": "white",
"enabled": true,
"thumbnail": "/api/v3/media/accounts/__REDACTED__/networks/157629/white/1193164/thumbnail/thumbnail.jpg?ts=1705786681&ext=",
"status": "done",
"battery": "ok",
"usage_rate": false,
"network_id": 157629,
"issues": [],
"signals": {
"lfr": 5,
"wifi": 5,
"temp": 55,
"battery": 3
},
"local_storage_enabled": false,
"local_storage_compatible": false,
"snooze": false,
"snooze_time_remaining": "",
"revision": "",
"color": "black"
} (note to self: I took the line of debug, stripped the timestamp, and turned it into legit json via: |
Damn, now that's some Grade-A debug work! So what changes need to be made to get the correct wifi level and battery voltage back? If you want to make the PR to fix this, I'm all for it! Having integers represent this stuff is, frankly, garbage. |
I'll create a PR now. I'd really like @mkmer to weigh in since they had something specific in mind when making those changes. |
PR created. Would also like @Rosi2143 to acknowledge this, and maybe clarify their use of get_unique_info() because from what I can tell, that only returns info for mini's and doorbells. Outdoor/Indoor cameras have their own REST API to call. But as a fellow user of blinkpy, could they just access the My apologies, I'm not intimately familiar with how others use this library so I may be speaking out of line. |
@dashrb - Since I only own a doorbell, it's been a tough road to test everything. I could only look at what was in front of me and it looks like I missed the root cause. |
@dashrb I'm on vacation right now so I really can't check this out (or I would dig in to see), I only have doorbells on my system with a sync module and the voltage level and wifi key was missing. How would this PR change what I was seeing in my JSON data? |
Alas, the doorbells and mini cameras seemingly do not report temperature, or voltage, or wifi_strength in dB. Full CameraThe blink app for a full camera shows:
The JSON includes these relevant fields:
Mini Camera (aka "owl")The blink app for a mini camera shows:
In blinkpy, the JSON for mini's is only read from the
Doorbell (aka "lotus")The blink app for my doorbell shows:
In blinkpy, the JSON for the doorbells is only read from the
|
Describe the bug
Previously, the camera config.signals.battery JSON field appeared to reflect the voltage of the XT* camera's battery, in centivolts (i.e. 167 would mean 1.67v) (Note: the doorbell and the MINI cameras appeared to not report voltage).
However, as of approximately 2023-12, the cameras no longer report their voltage. This appears to be a problem with the BLINK systems, not with blinkpy per se, as I show below. If you agree, then there isn't really any action you can take to fix/revert this functionality. But I open this ticket in hopes that an additional set of eyes will uncover something that I missed.
To Reproduce
Steps to reproduce the behavior:
logging.basicConfig(level=logging.DEBUG)
after the_LOGGER = logging.getLogger(__name__)
line, although there may be better ways to do this)blinkpy
version: v0.22.5Log Output/Additional Information
Almost all of my cameras are on USB mains power.
I previously observed that my doorbell, and my mini camera (handling the doorbell chime) never reported a battery voltage. My nightly info cronjob would print out information such as this (from 2023-11-29):
The only camera on an actual pair of AA batteries is my CB-Sidewalk camera, and it's pretty low, at 1.43v.
Started around 2023-12-01, ALL of these values became 0.00v. Today I looked into why this might be, adding the DEBUG as described above, and it appears that the BLINK servers no longer report the voltage. Interestingly, the config.signals.battery field shows a value of 3 for every camera except my CB-Sidewalk camera, which has a value of 2. I don't know why that is (although I acknowledge that the voltage of those AA's is probably below the desired level).
Here is some output during the blinkpy login and metadata fetch, showing what I am getting:
The text was updated successfully, but these errors were encountered: