ZoneMinder API - one of my cameras started returning None for MonitorId
Posted: Fri Oct 04, 2024 7:27 pm
Hi,
I use some python scripts to do object detection and send notifications via Pushover or email. The scripts access the ZoneMinder API via the requests python module. When setting up the monitors, I get the monitor ID as follows:
I've done a bit of debugging which indicates that item['Monitor_Status]['MonitorId'] is None for this particular camera. Actually, there are two monitors associated with this camera, one for the low-res stream and one for the high-res stream. Both return None, but that wasn't the case until recently, sometime within the last week, I think. It's also not the case for any of my other cameras. Any clues as to how to debug this issue?
I use some python scripts to do object detection and send notifications via Pushover or email. The scripts access the ZoneMinder API via the requests python module. When setting up the monitors, I get the monitor ID as follows:
Code: Select all
# Send request for api_path/monitors.json prior to this and return the response as 'r'
rj = r.json()
for item in rj['monitors']:
monitor = {}
try:
monitor['id'] = int(item['Monitor_Status']['MonitorId'])
monitor['name'] = item['Monitor']['Name']
except TypeError:
# Print a debugging message (not shown here)
continue