I had been looking for a solution where I could have my home automation system send me messages and process any feedback. Came across Telegram a couple of days ago by accident. Noticed also that the binding for openhab was V1 so didn’t explore much further on it. Then that Node-Red has a great node for interacting with Telegram and I am using a combination of Open-Hab/Node-Red. Love the combo as it makes building and testing flow easier - that is another topic.
Anyway, it turned out to be way easier than I ever expected and was up and working with 30mins at the basic level. NOTE: I don’t yet fully understand the security around Telegram Bots. Will update as I learn more. However, this was just such an exciting discovery I had to share. Also checked other topics on this. All very old and no tutorial. So let’s get started.
I have a Xioami Robot vacuum (which is totally brilliant and having a fur person in my house is essential to keeping things clean). However, I did not like the daily schedule option as sometimes I am home during the day (and you also never want to know what happens when a robot vacuum hits and unexpected dog leftover)
So automatic schedule turned off, but I’m also so forgetful that when I leave the house (and coast is clear for a robot run) that I don’t set the system off.
Use the Xioami Binding and OpenHab to start the vacuum via Alexa. There is alot on how to do this directly via the OpenHab binding which I actually missed and went the Node-red route. Either way works. I just prefer Node-Red as so each to inject start commands and see what happens. The Home Assistant site has the best details on how to configure the zones. (won’t link as might be considered heresy!).
Smart tip if you don’t have Andriod phone, install an emulator and download the third party app, it will give you all the co-ordinates you need).
Solution one worked really well for me. (along with the Alexa Local node - if this is of interest I can create new tutorial for that as well as there were a few gotcha on forming the node-red JSON package)
But I wanted to be able to have my system detect if I was out of the house and if the vacuum had not be done send me a reminder and ask would I like to start the house cleaning while I am away.
It was oddly way easier than I ever expected.
Using Node-Red follow the instructions from this site.
There is one small issue with the documentation which is how to send a message to your new Bot. Found you need to find the search option then find the Bot you created. Send it a message ‘hi’ and your are good to go.
Assembling the actual Node-Red flow is very simple and the read-me of the flow is exellant.
Here is mine
Won’t go into much detail on how to configure the nodes and they provide excellent guidance in the info panel along with the details of the readme for the node site.
At the moment my example has to have the timestamp inject triggered. I’ll update that as I figure out the rules to use of when my presense indicator goes to away, then probably wait an hour (incase I’m just walking the dog or such), then thinking of building in an indicator of have I already vacuumed that day.
The switch node allows you to ask a question and then provide answers options that appear on your phone as choices to make. Each choice represent and output node so you can process as you want. Mine sent the msg.payload to ‘on’ as my vacuum workflow expects that (happy to share that if anyone is interested).
Have seen an old post of someone asking about using this type of technique for locking and unlocking the door based on presence. I don’t fully understand the security of the bots your create on Telegram so recommend caution with this. A fallback here could be ask for a pin number before confirming the operation.
While not a fully OpenHab solution it is a very quick and fast way to (when using the OpenHab Nodes) to integrate question/answer solutions into your home automation system. I don’t have the skills Java skills to look at the current V1 Telegram solution, maybe someone can provide updates on how this might work as purely OpenHab.
The possibilities of being able to interact with your home automation system are endless.
Have fun and let me know what you think.