I’m struggling with the following:
I’m reading the waterpressure from my homeheating. Depending on the state (<>1.5bar) I would like to send a message to Telegram with the message that the pressure is “x”. (The Switch function is working correct) Therefore I defined 2 functions and in it variables to set the msg.payload. After that an empty chatbot-message to pass the msg.payload and finally connected to the chatbot-telegram-send.
It doesn’t send any message…
The function node is:
var pressure=flow.get('pressure') || 2;
pressure = msg.payload;
flow.set('pressure',pressure);
var msg1 = 'de waterdruk is ';
var msg2 = msg1 + pressure;
msg.payload = [msg2];
return msg;
I’ve been looking into doing this as well, and I think it’s because you’re not including the chat_id. The sender node doesn’t know what to do with it, since it’s not coming from the receiver node.
Documentation on starting a convo with your bot - https://github.com/guidone/node-red-contrib-chatbot/wiki/Start-conversation
Documentation for the formatting - https://github.com/guidone/node-red-contrib-chatbot/wiki/Conversation-node
EDIT:
I think all of that can be done with a conversation node before the message node.
thanks, the conversation node did the job.I’ve placed it after the function and that did solved it