Supergiovane / node-red-contrib-hikvision-ultimate

A native set of node for Hikvision Cameras, Doorbells, Alarms, Radars etc.
https://www.facebook.com/supergiovaneDev
MIT License
49 stars 11 forks source link

Data from the Telegram node is overwritten (Taking a picture and sending it via telegram) #43

Closed Cm-8 closed 2 years ago

Cm-8 commented 2 years ago

Hello!

Describe the Issue I try to integrate node-red-contrib-telegrambot with node-red-contrib-hikvision-ultimate to send a image from hikvision camera to a telegram user. my goals are:

  1. Send an image from a closed circuit camera to a fixed telegram subscriber when an event occurs
  2. Give the possibility to a telegram user to request an image with the command /getImage from a closed circuit camera

point 1 ✔️ I was able to do it using the "picture node" of Hikvision-Ultimate and setting after the picture node a function:

msg.payload = {}

msg.payload.chatId = XXXXXXXX  //TelegramUserId
msg.payload.content = msg.forEmail;
msg.payload.type = 'photo';
msg.payload.caption = "l'immagine che ho acquisito"

return msg;

point 2 ❌ Here i've a problem, because the picture node overvrite all the content of the msg. If a user writes to the bot, I have to save the chatID to reply to the same user (my bot reply to many users). I save the payload of telegram node to a variable "msg.backup", but nothing remains after the picture node. Is it possible that the image node keeps the contents of the previous msg?

Hikvision-Ultimate Version

Are you running node-red behind homematic, docker or anything similar?

Thanks

Supergiovane commented 2 years ago

Ciao Ale Long story short: you need that the input messages that goes to the hikvision picture node, is passed through and sent to the output, toghether with the picture?

Cm-8 commented 2 years ago

Ciao @Supergiovane,

Yes, in short: If you can keep the input messages that don't interfere with the node it's better. Otherwise I have implemented the join node between the before and after the picture node.

image

Supergiovane commented 2 years ago

Bravo, ti avrei suggerito la stessa cosa. Domani ci lavoro.

Supergiovane commented 2 years ago

node-red-contrib-hikvision-ultimate@1.0.64 è nelle palette, con la modifica che hai richiesto. Guarda il changelog per sapere dove viene messo il messaggio originale.

Cm-8 commented 1 year ago

Ciao @Supergiovane, scusa se scrivo qui. Visto che hai esperienza con hikvision, sei disponibile a sentirci brevemente? Non mi è chiaro come attivare il line crossing.