[PROJECT] Driver for Blink API

With the new drivers it works. Using the child device to arm/disarm the drivers correctly update the dashboard and the camera (it doesn't update the dashboard using the parent device which might be useful to arm/disarm all my camera's/sync modules at once but I guess that is how it was designed). Now the only thing I am missing is that the driver updates the status when I arm/disarm from the Blink app (which it does not seem to do)..... would that be possible?

Let me see if I can answer in order:
@nutcracker:
Updated should still exist for the children as well, I do not think I even changed anything there (it should also populate for the Parent, any time a child is updated). I will take a look. As for the battery... Ugh. That means that there are multiple battery responses spread across the data (I have been focused on getting all the data in first before consolidating). One of them must be returning OK but something else responds with numbers, so it is getting swapped around a bunch. I will have to pick one. Any preference?

@joeysliamg:
Glad to hear it is working better... I hate to be the bearer of bad news, but there is really no way for detecting changes made by the app UNLESS a poll occurs. If you make the change, then the Hubitat driver polls... it will show the latest the API has regardless of how it got set. But that response will be delayed by the polling interval at least.

1 Like

Thanks for the quick feedback. The poll didn't seem to work but I will try to do some testing later. In ST this was working via IFTT (and RBoy's device handler) but the whole point for me is to abandon IFTT. No worries....your drivers are already capable of integrating which is great stuff! Thanks.

1 Like

Could we have both? Visually knowing the batteries are β€œOk” is good... but knowing that they are at a 1 (not sure what the level is before Blink says change them - but knowing they are moving that way is useful if you know what I mean...).

@joeysliamg:
Hmm... poll should be working off of the Homescreen data, which is supposed to be a general overview of everything. I will have to put that on the list for tonight.

@nutcracker:
Yup. I generally prefer to have all data reported somewhere unless it really is of no apparent use. BUT... I can only report one of them to the "battery" event so it can be easily used in Rules and such. Since that is expecting % value, I will have to figure out which to include there. There is actually ANOTHER battery related value reported "Battery Voltage". Looking over my 3 cameras:

  • Camera 1 has Battery Number = 3, Battery Status = ok (or a number at times), Battery Voltage = 165
  • Camera 2 has Battery Number = 3, Battery Status = ok (or a number at times), Battery Voltage = 167
  • Camera 3 has Battery Number = 3, Battery Status = low (or a number at times), Battery Voltage = 134

If I assume the max battery voltage is ~3v (MAYBE 300 here?) due to there being 2 regular AA in series... I could work a % value from there (although if those 160s represent 1.6x volts... that seems pretty low and they say OK). I will have to see what happens when I change out the batteries in #3 and separate out what the # value shown in Battery Status is also.

2 Likes

Hi, this is super minor - and might be a MakerAPI question but I figured I'd ask while I'm looking at it.

I'm fetching the devices using the MakerAPI and seeing a lot of NULL value attributes returned. I'm wondering why the NULL value attributes are even returned in the JSON payload -- since it all adds up to about 40k of data for 3 cameras. Again, no big deal - just curious if that's the driver which fills all of these attributes in or MakerAPI.

        {
            "name" : "WiFi Connect Failure Count",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },

Here's an example of what's returned for just 1 camera

 << 29) 12.4k, DATA:
{
    "id" : "359",
    "name" : "Camera-88951",
    "label" : "front door",
    "attributes" : 
    [
        
        {
            "name" : "AC Power",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Account",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Account ID",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Alert Interval",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Alert Repeat",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Alert Tone Enable",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Alert Tone Volume",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Arm String",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Armed",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Auto Arm By Geo",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Auto Arm By Time",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Auto Test",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Backfill In Progress",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Battery Alarm Enable",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Battery Alert Account",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Battery Alert Count",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Battery Alert Status",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Battery Check Time",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Battery Number",
            "currentValue" : 3,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Battery Status",
            "currentValue" : "ok",
            "dataType" : "STRING"
        },
        
        {
            "name" : "Battery Voltage",
            "currentValue" : 164,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Battery Voltage Hysteresis",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Battery Voltage Interval",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Battery VoltageThreshold",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Busy",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Buzzer On",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Camera Error",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Camera ID",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Camera Key",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Camera Seq",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Clip Bitrate",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Clip Max Length",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Clip Rate",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Clip Seconds",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Clip Warning Threshold",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Continue Warning",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Created",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "DHCP Failure Count",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Daylight Savings Time",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Deleted",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Dev 1",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Dev 2",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Dev 3",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Early Notification",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Early Notification Compatible",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Early PIR Compatible",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Early Termination",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Early Termination Supported",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Enabled",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Encryption Key",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Error Codes",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "FW Git Hash",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Feature Plan ID",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Firmware Version",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Flip Image",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Flip Video",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Flip Video Compatible",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "ID",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "IPv",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Illuminator Duration",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Illuminator Enable",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Illuminator Intensity",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Invert Image",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Issues",
            "currentValue" : "[]",
            "dataType" : "STRING"
        },
        
        {
            "name" : "Join Available",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Join State",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "LFR 108 Wakeups",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "LFR Alert Count",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "LFR Channel",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "LFR Frequency",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "LFR Strength",
            "currentValue" : 5,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "LFR Sync Interval",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "LFR TB Wakeups",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Last Activity",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Last Backfill Completed",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Last Backup Completed",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Last Backup Started",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Last Command ID",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Last HB",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Last LFR Alert",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Last Snapshot Event",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Last Temp Alert",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Last Wifi Alert",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Lifetime Count",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Lifetime Duration",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Light Sensor CH0",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Light Sensor CH1",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Light Sensor Data New",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Light Sensor Data Valid",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "LiveView Continue Interval",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "LiveView Duration",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "LiveView Enabled",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "LiveView Mode",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "LiveView RSTP",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "LiveView Rate",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "LiveView Seconds",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Liveview Bitrate",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Local Storage Compatible",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Local Storage Enabled",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Local Storage Status",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "MAC Address",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "MFG Main Range",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "MFG Main Type",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "MFG Mez Range",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Manufacturer Mez Type",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Max Resolution",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Media ID",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Motion Detection Enabled",
            "currentValue" : "true",
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Motion Regions",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Motion Regions Compatible",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Motion Sensitivity",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Name",
            "currentValue" : "front door",
            "dataType" : "STRING"
        },
        
        {
            "name" : "Network ID",
            "currentValue" : 39640,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Network Key",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Network Origin",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "NetworkID",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "New Command",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Night Vision Exposure",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Night Vision Exposure Compatible",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "OS Version",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Offline Alert Count",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Onboarded",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Options",
            "currentValue" : null,
            "dataType" : "MAP"
        },
        
        {
            "name" : "PIR Rejections",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Ping Interval",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Privacy Zones Compatible",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Record Audio",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Record Audio Enable",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Retry Count",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "SM Backup Enabled",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Serial",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Server",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Siren Enable",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Siren Volume",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Snapshot Compatible",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Snapshot Enabled",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Snapshot Period Minutes Options",
            "currentValue" : null,
            "dataType" : "LIST"
        },
        
        {
            "name" : "Socket Failure Count",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Status",
            "currentValue" : "done",
            "dataType" : "STRING"
        },
        
        {
            "name" : "Status",
            "currentValue" : "done",
            "dataType" : "STRING"
        },
        
        {
            "name" : "Storage Total",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Storage Used",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Submit Logs",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Sync Module Error",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Sync Module ID",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Table Update Sequence",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Temp Adjust",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Temp Alarm Enable",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Temp Alert State",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Temp Alert Status",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Temp Alerts Enabled",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Temp Hysteresis",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Temp Interval",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Temp Max",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Temp Min",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Temperature Alert Count",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Thumbnail",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Thumbnail File",
            "currentValue" : "fw_7.96__Zi7psW4H_2020_09_18__12_44PM.jpg",
            "dataType" : "STRING"
        },
        
        {
            "name" : "Thumbnail Image",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Time 108 Boot",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Time DHCP Lease",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Time DNS Resolve",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Time First Video",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Time WLAN Connect",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Time Zone",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Total 108 Wakeups",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Total TB Wakeups",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Type",
            "currentValue" : "xt2",
            "dataType" : "STRING"
        },
        
        {
            "name" : "Unit Number",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Updated",
            "currentValue" : "2020-09-28T14:27:59+00:00",
            "dataType" : "STRING"
        },
        
        {
            "name" : "Usage",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Usage Rate",
            "currentValue" : "false",
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Video Description",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Video History Count",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Video Length",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Video Quality",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Video Recording Enable",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Video Recording Optional",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
        
        {
            "name" : "Video hz",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "WiFi Connect Failure Count",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "WiFi Strength",
            "currentValue" : -53,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "WiFi Timeout",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Wifi Alert Count",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "battery",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "html",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "temperature",
            "currentValue" : 77,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "temperature",
            "currentValue" : 77,
            "dataType" : "NUMBER"
        }
    ],
    "capabilities" : 
    [
        "TemperatureMeasurement",
        
        {
            "attributes" : 
            [
                
                {
                    "name" : "temperature",
                    "dataType" : null
                }
            ]
        },
        "Battery",
        
        {
            "attributes" : 
            [
                
                {
                    "name" : "battery",
                    "dataType" : null
                }
            ]
        },
        "Sensor",
        "Actuator"
    ],
    "commands" : 
    [
        "ArmSystem",
        "DisableMotionDetection",
        "DisarmSystem",
        "EnableMotionDetection"
    ]
}

I'm going to test this out!! I've got a native Android app dashboard which should be able to handle the RTSP feed. I did notice that this command is only available through the parent 'API' device and not the individual cameras. I'll try to make this work but if it's possible to allow each camera to send this command that would be best IMO.

My hope one day is to only 'include' my 3 cameras in the MakerAPI devices list; each one would be able to act on themselves (arm, video, thumbnail).

I think I read above though that you can't arm/disarm the whole system by sending 1 camera the "ArmSystem" command so I might also have to include the BlinkAPI device too

@jpage4500:

  • There are an awful lot of null data responses in the API. Right now I am still leaving them as state variables for the most part. However, I think MakerAPI (I am not really familiar with it though) is just taking the entire attribute list and if something does not have a value actually pushed to it it returns null. I also do not know how MakerAPI handles Events vs state Variables. I create everything in the BlinkChild driver as an attribute, but most data is only pushed to the children as a state variable. One example from your list "AC Power". My camera is reported as false for that (it appears to be a boolean, which makes sense). You might want to check what the camera is showing in the child device for it.
  • Yeah, I did not add the LiveView function into the child driver yet. I plan on doing that. I do not have an RTSP viewer (never had the need previously) so let me know if this works out.
  • Cameras (and the other stuff) CAN arm/disarm the network they are part of. If they have a state."Network ID" value they will send that to the parent, otherwise they put an error in the log.

Thanks for the quick reply! If a camera can arm/disarm the whole system by itself that's great too -- from a dashboard perspective I only really need the cameras to be displayed.. clicking on a camera can prompt to show video, arm/disarm the whole system or just enable/disable motion detection on that camera.

(as an aside - given how Blink works I'm leaning towards just keeping the whole system armed at all times and then just using enable/disable motion - say at a certain time of night or manually.. anyway, I'm not there just yet)

Anyway, from the camera itself is there a way to tell if the system is armed? I see an Armed attribute but it's null. I'd like to change the dashboard tile based on the camera being armed or not (as well as motion enabled)

        {
            "name" : "Armed",
            "currentValue" : null,
            "dataType" : "BOOL"
        },
...
        {
            "name" : "Motion Detection Enabled",
            "currentValue" : "true",
            "dataType" : "BOOL"
        },

Let’s go with β€œOK” then... (Blink mobile app does the same). I’m also showing voltage as well on dashboard so I can monitor behaviour...

Ran into a snag trying to get this working today.. it seems that the camera device isn't listing it's own camera ID which is needed for the RTSP stream. This is from the MakerAPI device response - but I do see it in the camera details on HE

        {
            "name" : "Camera ID",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },

image

I do see the camera ID as part of the device name though.. so, at least workable

    "name" : "Camera-88951",

last note - I was able to call the GetCameraLiveCommand but not seeing any kind of RTSP stream in the response.

Device 357 is the API and 88989 is the camera ID

Here's the full request/response:

 31) GET http://192.168.0.202/apps/api/38/devices/357/GetCameraLiveView/88989
 DONE: 31) 218ms http://192.168.0.202/apps/api/38/devices/357/GetCameraLiveView/88989
 << 31) 977b, DATA:
{
    "id" : "357",
    "name" : "Blink",
    "label" : "Blink",
    "attributes" : 
    [
        
        {
            "name" : "Armed System(s)",
            "currentValue" : null,
            "dataType" : "LIST"
        },
        
        {
            "name" : "AuthorizationFailures",
            "currentValue" : null,
            "dataType" : "NUMBER"
        },
        
        {
            "name" : "Authorized",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Camera(s) With Motion Enabled",
            "currentValue" : "[88951]",
            "dataType" : "LIST"
        },
        
        {
            "name" : "ClientID",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Driver",
            "currentValue" : null,
            "dataType" : "STRING"
        },
        
        {
            "name" : "Updated",
            "currentValue" : "2020-09-28T23:24:28+00:00",
            "dataType" : "STRING"
        },
        
        {
            "name" : "Version",
            "currentValue" : "Up to date",
            "dataType" : "STRING"
        }
    ],
    "capabilities" : 
    [
        "Refresh",
        "Sensor",
        "Actuator"
    ],
    "commands" : 
    [
        "ArmSystem",
        "CheckSyncModule",
        "DisableMotionDetection",
        "DisarmSystem",
        "EnableMotionDetection",
        "GetCameraInfo",
        "GetCameraLiveView",
        "GetCameraSensors",
        "GetCameraUsage",
        "GetHomescreen",
        "GetNetworkStatus",
        "GetNetworks",
        "GetNotifications",
        "GetSyncModuleEvents",
        "GetVideoEvents",
        "RequestPIN",
        "VerifyPIN",
        "refresh"
    ]
}

@jpage4500:
It seems like a lot of the things here is because of Maker API and how it is interacting with how I write my drivers. Since I have never used it before and never apparently had anyone interacting with it using my drivers before, this is "fun". From what I can tell, it lists every attribute and expects every attribute to be populated using an Event.

For the specific cases:

  • Camera's do not "know" they are part of an Armed system, it is not a value returned for any of them. The only reason you are seeing it (and it is null) is because it is listed as an attribute. Other devices (such as Network) DO receive it, and it is an Event for them even. I suppose it is possible for me to try to come up with a way to pass Armed to all cameras in a Network, but in reality the Armed is for Networks themselves (not even the parent overall since that could have multiple Networks, not all of them Armed).
  • Camera have an "ID" value, but again it is a state variable, not an Event.
  • As for RTSP, you are not seeing it because I accidentally called the attribute "LiveView RSTP" in the BlinkChild.groovy. It is posted as Event "LiveView RTSP" by the parent (I caught the mixup there before I posted it but apparently did not notice I had it wrong in the child driver), but Maker API cannot see it because the attribute name is wrong.

Updated Version(s):
BlinkAPI.groovy = 0.1.9
BlinkChild.groovy = 0.1.5

Change(s):

  • ID is now posted as an Event for all children. Any other ID data that is received (Network ID, Camera ID, etc...) are also posted as Events.
  • Minor changes to ProcessDevices, mostly around "signals". Before this got returned back through (it is a subset of data for Homescreen) but now it is being handled separately because it ALSO had a "battery" field that returned a different value than the main "battery" field... despite having the same name.
  • Battery attributes have been renamed and split up a bit to prevent overlap.
  • Changes to the way "Updated" is performed. Arm/Disarm responses for some reason does NOT return an "updated_at" value like Enable/Disable responses do, so they were changing to null. Now it calls a Date() command for Arm/Disarm to at least provide the current date/time it was run.
  • Camera children can now run the GetCameraLiveView command for themselves.
  • RTSP is now properly named in the child driver, so it should show up properly.

Different Topic(s)

  • With the battery changes mentioned, there should be a couple more options, but I have not keyed to a specific one to report as "battery" from now on. I am leaning towards Voltage (converted to an useful % of course). As one of my cameras now reports a low battery and the app says to replace it I planned on doing that while I was coding this evening. Got batteries, went to do it, and realized there is no way I am climbing on a ladder in the dark to try it tonight. :man_shrugging: It can wait until tomorrow. Hopefully fresh batteries will provide another set of values that I can then narrow down what it is trying to tell me and give you all something more useful.
2 Likes

Updated this morning, all seems ok.
I did see this in the logs:

2020-09-30 08:05:13.493 errorjava.lang.NullPointerException: Cannot invoke method size() on null object on line 1358 (ProcessNetworks)

Question. Overnight I saw a lot of unauthorised messages, every 10mins (my schedule). I thought the driver only attempted up to 5 times and then stopped?
(wanting to avoid my account being disabled).

Cheers!

The driver is supposed to attempt to reauthorize 5 times then give up... but the polling is still going on (I do not interrupt that). I just stop the reauthorization repeats so it does not "add" to the mess.

But it makes sense to stop the whole thing... so I will have to look at pausing the refresh until reauthorized OR have it run it but just not actually DO the check until it is reauthorized.

Thanks for the heads up about 1358... guess I need to work a bit more at that one.

2 Likes

Camera children can now run the GetCameraLiveView command for themselves

awesome - thank you!

RTSP is now properly named in the child driver, so it should show up properly

I tried making this request but didn't get anything back in the MakerAPI response so not sure how I'm going to be able to use this in my app.

I did see the variable listed in the HE app page though and it looks like this:

LiveView RTSP : immis://3.216.94.91:443/<SNIP>?client_id=1

I tried hardcoding this URL in the app and then later tried in VLC for Mac (which supports RTSP streams) and they couldn't open it. I even tried renaming the "immis://" to "rtsp://" but still nothing. Anyway, I'm guessing this is just what's being returned from Blink so I'll check around and see if anyone has been able to view video using it (w/out the Blink app)


Video/Thumbnails aside - I think the biggest thing for me now is just supporting the basic arm/disarm, enable/disable motion.

The 1 thing which would really simplify my design is just knowing if an individual camera is armed or not. I know it's got motion enabled or not, but if a camera has motion enabled and the system isn't armed -- it's not going to do anything. So, if there's any way to set the armed state for each camera (even though it's really part of the whole network or sync module) that would be a huge help!

I wonder if something changed since this was first created: BlinkMonitorProtocol/liveview.md at master Β· MattTW/BlinkMonitorProtocol Β· GitHub

It seems to indicate a return of "rtsp://" URL and no mention of any "immis://".. anyway, it's not critical

@jpage4500:
All three of mine have a more normal looking URL. Any other particular settings related to the video showing in your state variables maybe?:

rtsps://lv<#>-app-prod.immedia-semi.com:443/<STUFF>?client_id=<CLIENTID>&blinkRTSP=true

2 of mine are xt, the 3rd is a white (Indoor).

I also noticed that LiveView only has a duration of 300... which I assume means 300 seconds. Not sure how long before a new a new URL is required though. In my testing I could request another LiveView and it would have a new URL within ~1 min (50 seconds), but when I requested one in under 30 seconds (26 to be exact) I got a 409 error (that I still need to build into the response handling).

All of my cameras are XT2. I guess maybe there's something else they added to the API for this version.

I'm wondering if I can format my URL to look like the one you posted -- maybe that would work if the server is backwards compatible with older Blink apps? Just 1 question.. what is that "lv<#>" stand for?