andres
(Andrés)
July 2, 2018, 4:49pm
1
Hi,
I want to do something like this:
When I send a Telegram Command (like /runCmd), I want that HomeAssistant run a predefined shell command (like ‘ls -l’) and return the output as a Telegram message.
How can I do that?
Sorry about my english, I hope you can understand my question.
Thanks in advance.
Andrés.
Use AppDaemon so you can enjoy the full power of Python
See an example at the end of https://www.home-assistant.io/components/telegram_bot/
(though you should note that the example is a bit outdated - the import statement for AppDaemon 3.x differs, see http://appdaemon.readthedocs.io/en/latest/ )
nickrout
(Nick Rout)
July 3, 2018, 8:05am
3
Alternatively, take the unix approach and break this down into it’s parts.
Create a command line sensor that outputs ls -l
Create a telegram command that takes the content of the command line sensor.
EDIT: corrected wine induced typos.
andres
(Andrés)
July 3, 2018, 8:35pm
4
Yeah, this was my first idea,
but how can i create a command line sensor that not refresh automatically, only when I call them?
andres
(Andrés)
July 3, 2018, 8:35pm
5
Thanks!
I don’t know AppDaemon, I’ll see it later!