Skip to content
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

JideTech ONVIF Camera - #24

Closed
jdesai61 opened this issue Jan 3, 2021 · 5 comments
Closed

JideTech ONVIF Camera - #24

jdesai61 opened this issue Jan 3, 2021 · 5 comments

Comments

@jdesai61
Copy link

jdesai61 commented Jan 3, 2021

I was playing around with my JideTech cameras and notices that the "simpleItem" they send in motion event is an array (see debug below)

[1609711795443] INFO  (ONVIF): ONVIF  onSubscriberEvent {"topic":{"_":"tns1:RuleEngine/CellMotionDetector/Motion","$":{"Dialect":"https://www.onvif.org/ver10/tev/topicExpression/ConcreteSet"}},"message":{"message":{"$":{"UtcTime":"2021-01-03T22:09:55.676"},"source":{"simpleItem":[{"$":{"Name":"Window","Value":0}},{"$":{"Name":"Source","Value":"000"}},{"$":{"Name":"VideoSourceConfigurationToken","Value":"VideoSourceToken"}},{"$":{"Name":"VideoAnalyticsConfigurationToken","Value":"VideoAnalyticsToken"}},{"$":{"Name":"Rule","Value":"MyMotionDetectorRule"}}]},"data":{"simpleItem":[{"$":{"Name":"Motion","Value":1}},{"$":{"Name":"State","Value":true}},{"$":{"Name":"IsMotion","Value":true}}]}}}}

Is this allowed in ONVIF standard? If so, it will be nice to have a fix. For now, I hacked SubscriberGroup.js line from

    const eventValue = event.message.message.data.simpleItem.$.Value;

to

   const eventValue = event.message.message.data.simpleItem[0].$.Value;

And it worked for my camera - obviously this breaks other cameras that don't send an array. Perhaps a check on testing for array could be added as a fallback? Thanks

@ksupipr
Copy link
Contributor

ksupipr commented Jan 5, 2021

Hi, specification. message.data may be array
https://www.onvif.org/specs/core/ONVIF-Core-Specification.pdf

I fix it make from simpleItem array to object like {$.Name, $.Value}
Check for old cameras and create pull request

@jdesai61
Copy link
Author

jdesai61 commented Jan 5, 2021

@ksupipr I looked at your branch and didn't see any changes or pull requests. Am I missing something? Thanks

@ksupipr
Copy link
Contributor

ksupipr commented Jan 11, 2021

@ksupipr I looked at your branch and didn't see any changes or pull requests. Am I missing something? Thanks

Holidays )
Create branch tomorrow, write comment with link here

@ksupipr
Copy link
Contributor

ksupipr commented Jan 12, 2021

@jdesai61 https://github.com/ksupipr/onvif2mqtt/tree/bugfix/issue24

I think what value send to the event, for compatibility with old projects.
Now send full object (key: value)

@dmitrif
Copy link
Owner

dmitrif commented Feb 4, 2021

Resolved with #34 . Reopen if not, thanks!

@dmitrif dmitrif closed this as completed Feb 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants