Get a boolean output from the Hikvision node

I think you will have to ask the author by posting an issue on the nodes GitHub page.

Ok, I have it already done, I let it know.
Thanks for your help!

Gr. Johannes

apologies if I'm late to the party and missing something vital. If the key is missing entirely can you not use a switch node to check if msg.payload - has Key - isDataRetransmission ? and if not then do something ?

Hi,

I have put a switch in the output:


Debug 9 has no output.

The connection of the PTZ node was available.

That is asking if msg.payload is equal to msg.payload.isDataRetransmission.

How can I know that?

Reaction of the Author:

You need to provde hime with an example flow and point out that the node is not responding with the message that the readme says it should. It says:

Output PIN 1

msg = {
{
    "payload": true, // true after the camera has reached the PTZ preset position
    "_msgid": "b07e50f6.86a72"
}

But you are not seeing that, you are seeing something completely different. As I understand it you should just need to wait for the above message.

I have ask the question to him

For reference, here is the issue you have posted.

You have not provided a sample flow, and shown the message you are sending to the node.
You have not shown the message that you are receiving after sending the message to the node.
You have not pointed out that this is not the message shown in the docs.

For a node author to spend time looking at your problem you must explain clearly what is happening, what should happen, and how to easily replicate the problem.

I meant like this

Hi guys. I'm also here in the forum.
@Johannesje, have you solved the issue?

1 Like

Hi, no I have it still not solved.
I hope I can have a boolean out of the PTZ node.

Hello all,

I have figure out another way to get my boolean from the PTZ node:



During traveling of the camera my output is true otherwise false.
Gr. Johannes

Your if Pos = false is setting Pos to false. Equality tests in JavaScript are == or ===

Why not simply use a switch node to test msg.payload.isDataRetransmission is false?

You mean the switch suggested by "dceejay" earlier in this post?
This was not working.

Does your function ever give a false output? As you have written it it will always set msg.payload to true. All you are doing is using any output on pin1 to indicate that movement is complete.

@Supergiovane, after sending a set reset message to the PTZ node should the node send a message like

msg = {
{
    "payload": true, // true after the camera has reached the PTZ preset position
    "_msgid": "b07e50f6.86a72"
}

That is what the docs suggest to me. @Johannesje is seeing a completely different message, apparently.

You are right, i have always a true. When there is no movement of the camera there is no output.
Otherwise I have also a true output when the camera is starting recording

That is because of the error in your code as pointed out by Steve.