Telegram - sending commands to trigger flows and questions

Sure, but how do I get the buttons to show as options in on my bot?

It already should!

I checked the example, and it should appear like this:
afbeelding

I forgot to mention, you have to send a message, like test without the /, to the bot to get the menu.

FYI, The final result could be something like this:

Notice the /m-node prior to the Main Menu. When a message is send for the first time it will enter the Main Buttons Menu. When your inside the Telegram send and respond loop the menu will not be shown every time, only when you send a /m option again (you can also add this as a button in the Main Button Menu).

Also there is a /stop command node added to exit the Telegram send and respond loop. The attached Telegram Sender Node at the end must have the ‘Track’ option disabled.

1 Like

Now it’s all making sense and working sort of. Only thing is now the flow kind of broke.

So now the /as or payload isn’t sent to the switch I had configured to convert msg.payload from /as to arm_away.

I have it setup exactly as you do. So my question is where do you send the /as to?

I’m a complete rookie concerning Home Assistant. I use several IoT devices and gateways so I use Node Red as my main ‘configurator and automation’ server.

The basic protocol I use is MQTT, also for HA. This way it’s easy to ‘trigger’ events on all Home Automation devices. One big advantage is that I don’t have to dig deep into all my Home Automation devices/gateways.

In short, if I want to trigger an event, I just post it to a certain topic on my MQTT broker.

FYI, don’t forget to close the loop to the Telegram Sender Node (for example with a text that the command is executed or something like that). That’s why I have put the red arrows into the final result picture.

BTW, do you mind if I link this topic to my https://community.home-assistant.io/t/howto-setting-up-a-telegram-bot-for-all-your-home-automation-messages topic, as an example?

I’m using MQTT as well :slight_smile: Home Assistant is just what pulls it all together.

Sure, you can link this to anywhere - I don’t own this :slight_smile: and it may help someone else!

As for closing the loop, is there a downside to not closing that loop? I don’t plan to use the bot for anything else. Just seems to show the menu again and I’m ok with that.

Thanks again.

1 Like

I don’t use your setup, I just made this as an example to get you started :crazy_face:

Well, then you have to re-attach to the main Telegram again (starting at the beginning of the loop, showing the Main Menu every time again). If that’s alright with you, then it shouldn’t be a problem.

Thank you very much, it’s is highly appreciated!

You’re welcome!

hi, i have similar problem, look at that:

i dont understand how to make it on/off based on the button i clicked in the bot. i must miss some node in between, no?

thank you!

I still can’t figure this out.

What package do this blue nodes come from?

Checking your flow, it does have some flaws.
1 - Put an authorized-node after the Telegram Receiver. Otherwise anyone can send commands!
2 - When a ‘/1’ message is received the ‘pick button’-buttons are returned, ehh, then what?
In the ‘pick button’-node you must configure a command to execute (postback value). Behind the Telegram-sender node you have to return the loop to all your (button)options you have. Check the final result example I posted before.

home assistant hassio add on

I don’t use hassio. Nevermind, found it as node-red-contrib-home-assistant

i still dont understand… sorry, but how even in your final result, how to configure the main menu so when you pick one he will run /m and not /as


how node red will pass my value button1 “start” to a command node

start should be /start (the / is important otherwise the command-node will not be triggered) , and /start has to be added as command node.

nodered home assistant package.

I have this, but the commands are never run. There is a disconnect somewhere. Just don’t know where. @Asaf_Davidof has the same issue I have.