UniFi Protect Binding (Cloudkey gen2+, Dream Machine Pro, NVR)

Thanks Seaside, and apologies I was asleep at the wheel on that one! Looks like the Openhab repo wasn’t set up properly, and indeed it is looking much more promising now with the versioning issue sorted out. For the last 12 hours the logs are clean and it’s been working as expected.

1 Like

My apologies for the late reply!

I didn’t upgrade any of my UniFi Software to the beta channels (sticking with the Official channel), and all firmware is always kept up-to-date, but did end up grabbing your Beta6 release of the binding and dropped it in the add-on folder, and am happy to report it’s happily working again, although one thing that has persisted is heatmap warnings/errors for motion events.

2022-07-23 19:02:19.751 [WARN ] [otect.internal.model.UniFiProtectNvr] - Heatmap request resulted in a error size image
2022-07-23 19:02:19.764 [WARN ] [otect.internal.model.UniFiProtectNvr] - Heatmap request resulted in a error size image
2022-07-23 19:02:19.764 [ERROR] [l.thing.UniFiProtectBaseThingHandler] - Failed to set heatmap, event type not present: UniFiProtectEvent [type=motion, start=1658624521598, end=null, camera=removed, score=100, id=62dc9a1500d6a103870204b5, metadata=MetaData [objectType=null, objectCoords=null, objectConfidence=null], modelKey=event, partition=null, thumbnail=e-62dc9a1500d6a103870204b5, heatmap=e-62dc9a1500d6a103870204b5, smartDetectTypes=[], smartDetectEvents=[62dc9a160099a103870204b7]] or invalid heatmap: null
2022-07-23 19:02:39.375 [WARN ] [l.thing.UniFiProtectBaseThingHandler] - Failed to find event fo eventId: 62dc9a1500d6a103870204b5 cacheSize: 2
2022-07-23 19:02:39.434 [WARN ] [l.thing.UniFiProtectBaseThingHandler] - Failed to find event fo eventId: 62dc9a1500d6a103870204b5 cacheSize: 2
2022-07-23 19:02:42.045 [WARN ] [otect.internal.model.UniFiProtectNvr] - Heatmap request resulted in a error size image
2022-07-23 19:02:42.063 [WARN ] [otect.internal.model.UniFiProtectNvr] - Heatmap request resulted in a error size image
2022-07-23 19:02:42.063 [ERROR] [l.thing.UniFiProtectBaseThingHandler] - Failed to set heatmap, event type not present: UniFiProtectEvent [type=motion, start=1658624545152, end=null, camera=removed, score=0, id=62dc9a2c02e8a103870204bb, metadata=MetaData [objectType=null, objectCoords=null, objectConfidence=null], modelKey=event, partition=null, thumbnail=e-62dc9a2c02e8a103870204bb, heatmap=e-62dc9a2c02e8a103870204bb, smartDetectTypes=[], smartDetectEvents=[62dc9a160099a103870204b7]] or invalid heatmap: null
2022-07-23 19:03:57.039 [WARN ] [otect.internal.model.UniFiProtectNvr] - Heatmap request resulted in a error size image
2022-07-23 19:03:57.053 [WARN ] [otect.internal.model.UniFiProtectNvr] - Heatmap request resulted in a error size image
2022-07-23 19:03:57.053 [ERROR] [l.thing.UniFiProtectBaseThingHandler] - Failed to set heatmap, event type not present: UniFiProtectEvent [type=motion, start=1658624619682, end=null, camera=removed, score=43, id=62dc9a770131a103870204d9, metadata=MetaData [objectType=null, objectCoords=null, objectConfidence=null], modelKey=event, partition=null, thumbnail=e-62dc9a770131a103870204d9, heatmap=e-62dc9a770131a103870204d9, smartDetectTypes=[], smartDetectEvents=[62dc9a7600e0a103870204d8]] or invalid heatmap: null
2022-07-23 19:04:25.744 [WARN ] [otect.internal.model.UniFiProtectNvr] - Heatmap request resulted in a error size image
2022-07-23 19:04:25.757 [WARN ] [otect.internal.model.UniFiProtectNvr] - Heatmap request resulted in a error size image
2022-07-23 19:04:25.757 [ERROR] [l.thing.UniFiProtectBaseThingHandler] - Failed to set heatmap, event type not present: UniFiProtectEvent [type=motion, start=1658624648421, end=null, camera=removed, score=42, id=62dc9a940006a103870204e3, metadata=MetaData [objectType=null, objectCoords=null, objectConfidence=null], modelKey=event, partition=null, thumbnail=e-62dc9a940006a103870204e3, heatmap=e-62dc9a940006a103870204e3, smartDetectTypes=[], smartDetectEvents=[62dc9a8f0290a103870204e2]] or invalid heatmap: null

The only thing I really have set up in my sitemap is the following:

I see this was brought up by someone else back in April, UniFi Protect Binding (Cloudkey gen2+, Dream Machine Pro, NVR) - #188 by Private and I too do not care about heatmaps, so it’s a non issue, but definitely adds several extra lines to my logs every time motion is detected.

Thanks for being so prompt at replying and apologies again, I only got around to being able to install the beta binding yesterday. :slight_smile:

Hi!

I have a lot of these in my log:

16:59:03.825 [DEBUG] [.websocket.UniFiProtectEventWebSocket] - Frame: {“action”:“update”,“newUpdateId”:“1d9a0645-401f-4456-8e13-8894dbc8f3af”,“modelKey”:“camera”,“id”:“6193cb5702ad880387000403”,“mac”:“68D79ADF859F”,“token”:null}
16:59:03.826 [ERROR] [.websocket.UniFiProtectEventWebSocket] - Failed to parse json
16:59:03.827 [DEBUG] [.websocket.UniFiProtectEventWebSocket] - Frame: {“action”:“update”,“newUpdateId”:“941550f1-708e-4066-aa6f-9702b8ed18b8”,“modelKey”:“camera”,“id”:“6193cb57030c880387000405”,“mac”:“68D79ADF84D8”,“token”:null}
16:59:03.828 [ERROR] [.websocket.UniFiProtectEventWebSocket] - Failed to parse json
16:59:03.829 [DEBUG] [.websocket.UniFiProtectEventWebSocket] - Frame: {“action”:“update”,“newUpdateId”:“443dec18-563b-450b-b59c-9d49e766cc31”,“modelKey”:“camera”,“id”:“6193cb5702e9880387000404”,“mac”:“68D79ACF5CEB”,“token”:null}
16:59:03.830 [ERROR] [.websocket.UniFiProtectEventWebSocket] - Failed to parse json
16:59:03.831 [DEBUG] [.websocket.UniFiProtectEventWebSocket] - Frame: {“action”:“update”,“newUpdateId”:“15e4ed72-2b42-4456-bbf2-b4790311b0ae”,“modelKey”:“camera”,“id”:“6193cb570253880387000402”,“mac”:“B4FBE49FA750”,“token”:null}
16:59:03.832 [ERROR] [.websocket.UniFiProtectEventWebSocket] - Failed to parse json
16:59:03.850 [DEBUG] [.websocket.UniFiProtectEventWebSocket] - Frame: {“action”:“update”,“newUpdateId”:“d4be2ebd-ee3c-4f64-985d-aa159c8727bf”,“modelKey”:“camera”,“id”:“6193cb5702ad880387000403”,“mac”:“68D79ADF859F”,“token”:null}
16:59:03.852 [ERROR] [.websocket.UniFiProtectEventWebSocket] - Failed to parse json
16:59:03.877 [DEBUG] [.websocket.UniFiProtectEventWebSocket] - Frame: {“action”:“update”,“newUpdateId”:“cf89534d-2980-42e6-9572-76a178ff85fb”,“modelKey”:“camera”,“id”:“6193cb570253880387000402”,“mac”:“B4FBE49FA750”,“token”:null}
16:59:03.884 [ERROR] [.websocket.UniFiProtectEventWebSocket] - Failed to parse json
16:59:03.885 [DEBUG] [.websocket.UniFiProtectEventWebSocket] - Frame: {“action”:“update”,“newUpdateId”:“d695bcb1-e3a1-4abb-bf7a-ab55b4f471b4”,“modelKey”:“camera”,“id”:“6193cb57030c880387000405”,“mac”:“68D79ADF84D8”,“token”:null}
16:59:03.886 [ERROR] [.websocket.UniFiProtectEventWebSocket] - Failed to parse json
16:59:03.887 [DEBUG] [.websocket.UniFiProtectEventWebSocket] - Frame: {“action”:“update”,“newUpdateId”:“f1a15719-0204-40ac-b4f1-544fd34aff8a”,“modelKey”:“camera”,“id”:“6193cb5702e9880387000404”,“mac”:“68D79ACF5CEB”,“token”:null}
16:59:03.888 [ERROR] [.websocket.UniFiProtectEventWebSocket] - Failed to parse json
16:59:04.103 [DEBUG] [.websocket.UniFiProtectEventWebSocket] - Frame: {“action”:“update”,“newUpdateId”:“91440a8d-20b0-4317-ad5d-190ceeacd16c”,“modelKey”:“user”,“id”:“6193cb57011f880387000401”,“mac”:“”}
16:59:04.105 [ERROR] [.websocket.UniFiProtectEventWebSocket] - Failed to parse json
16:59:04.107 [DEBUG] [.websocket.UniFiProtectEventWebSocket] - Frame: {“action”:“update”,“newUpdateId”:“5c4807cf-18e5-47b4-8e04-441cc515f44a”,“modelKey”:“user”,“id”:“6193cb5900e3880387000406”,“mac”:“”}
16:59:04.110 [ERROR] [.websocket.UniFiProtectEventWebSocket] - Failed to parse json
16:59:04.114 [DEBUG] [.websocket.UniFiProtectEventWebSocket] - Frame: {“action”:“update”,“newUpdateId”:“ba9cb60b-b30b-4d98-85d3-b971b8012135”,“modelKey”:“user”,“id”:“6193cb5900e3880387000406”,“mac”:“”}

I have Unifi Dream Machine Pro and Unifi Protect 2.1.1.
Do you have any clue what is causing this? It slows down my openhab server a lot.

There is a byte with a value 2 at the end of every JSON. Maybe this is the reason?

I’ll have a look at the heatmap issue. Or at least remove the warning notice.

  • Install latest unifi firmware
  • Install latest UniFi Protect version

Install the latest version of the openHab UniFi Protect binding should be the BETA6 version.

This is a UniFi 2.1.1 issue that’s fixed in the BETA6 version
Regards, S

I’m getting the failed to parse json error as well.

unifiprotect-3.x.x-BETA6

UDM Pro
Unifi OS 1.12.25
Unifi Protect 2.1.1

2022-07-26 08:07:18.111 [ERROR] [websocket.UniFiProtectEventWebSocket] - Failed to parse json

2022-07-26 08:07:18.113 [ERROR] [websocket.UniFiProtectEventWebSocket] - Failed to parse json

2022-07-26 08:07:18.115 [ERROR] [websocket.UniFiProtectEventWebSocket] - Failed to parse json

2022-07-26 08:07:18.715 [ERROR] [websocket.UniFiProtectEventWebSocket] - Failed to parse json

This is weird:

openhab> log:set DEBUG org.openhab.binding.unifiprotect
Error executing command: Unable to set level for logger

Restart openhab and see if you can set debug log.

Works for me, set:

openhab> log:set DEBUG org.openhab.binding.unifiprotect 

You could test

openhab> bundle:list |grep -i unifi
233 │ Active │  80 │ 3.4.0.202207221403     │ openHAB Add-ons :: Bundles :: UniFi Protect Binding

To see that the binding is actually activated.
Please try and login normally in the unifiprotect gui as well with the same credentials so you know that works.
If you have 2FA activated you need to disable it.

/S

Thanks for the help. I forget to uninstall the original binding before dropping in the jar file.

1 Like

Hi,
I’m getting basically constantly these errors
(UDMPro + G4 cams)

any clue? or possibility to disable heatmaps as Iam not using them anyway?

2022-08-06 12:16:19.065 [WARN ] [otect.internal.model.UniFiProtectNvr] - Heatmap request resulted in a error size image
2022-08-06 12:16:19.078 [WARN ] [otect.internal.model.UniFiProtectNvr] - Heatmap request resulted in a error size image
2022-08-06 12:16:19.078 [ERROR] [l.thing.UniFiProtectBaseThingHandler] - Failed to set heatmap, event type not present: UniFiProtectEvent [type=motion, start=1659780969534, end=null, camera=6298691d033d1e0387005a3e, score=78, id=62ee3f6c02928003870140c3, metadata=MetaData [objectType=null, objectCoords=null, objectConfidence=null], modelKey=event, partition=null, thumbnail=e-62ee3f6c02928003870140c3, heatmap=e-62ee3f6c02928003870140c3, smartDetectTypes=[], smartDetectEvents=[62ee3eeb00ad8003870140ab]] or invalid heatmap: null
2022-08-06 12:16:29.442 [WARN ] [l.thing.UniFiProtectBaseThingHandler] - Failed to find event fo eventId: 62ee3f6c02928003870140c3 cacheSize: 5
2022-08-06 12:16:29.536 [WARN ] [l.thing.UniFiProtectBaseThingHandler] - Failed to find event fo eventId: 62ee3f6c02928003870140c3 cacheSize: 5
2022-08-06 12:16:34.020 [WARN ] [otect.internal.model.UniFiProtectNvr] - Heatmap request resulted in a error size image
2022-08-06 12:16:34.071 [WARN ] [otect.internal.model.UniFiProtectNvr] - Heatmap request resulted in a error size image
2022-08-06 12:16:34.071 [ERROR] [l.thing.UniFiProtectBaseThingHandler] - Failed to set heatmap, event type not present: UniFiProtectEvent [type=motion, start=1659780985518, end=null, camera=6298691d033d1e0387005a3e, score=0, id=62ee3f7c02518003870140cb, metadata=MetaData [objectType=null, objectCoords=null, objectConfidence=null], modelKey=event, partition=null, thumbnail=e-62ee3f7c02518003870140cb, heatmap=e-62ee3f7c02518003870140cb, smartDetectTypes=[], smartDetectEvents=[62ee3eeb00ad8003870140ab]] or invalid heatmap: null

for now solved by nasty

log:set OFF org.openhab.binding.unifiprotect

:slight_smile: