I’m playing a bit with telegram notifications, and my aim is to prepare some automations that will trigger some scripts, based on the agument given. all looks kinda easy, but I’m hitting a wall now, probably just because additional ‘’ which I can’t remove…
the same result like with my version - outputting ‘keyword’ [with ‘’] and not respecting the condition
it is impossible that it is impossible… I;m out of ideas now…
check if you have “data” or “data_template” when setting the var_text variable. it depends on if you use templates or not, but maybe somehow you did forget to enter this correctly?
Invalid config for [automation]: invalid template (TemplateSyntaxError: unexpected char ‘‘’ at 36) for dictionary value @ data[‘action’][0][‘data_template’][‘var_text’]. Got None. (See /config/configuration.yaml, line 153). Please check the docs at Automation - Home Assistant
I think this is the cause. change the quotes to " " or ’ ’ [you can see the difference in the code view in your post - you used the ones that has different opening and closing characters, just use the simple ones]
I’m planning to make some cleanings so my config could see the public light, but TBH I’m not sure if it will ever be ready… that’s why easier is for me to just cut out a bit… must try to make something with the pieces tho.
anyway.
I’ve got some automatic notifications and some /keyword triggered responses on Telegram.
most important [for me] automatic ones:
first of all - it notifies me when RPi/Hassio is up after a reboot [so I know if reboot went ok or if there’s something wrong]; it notifies me when my second RPi [with MySQL server & MQTT broker] is up after a reboot or it’s gone for longer than 5 minutes [so I know if my system is functioning correctly].
it also notifies me if I’ll keep my terrace doors open for too long in wintertime - system shuts down the heater [to preserve energy and not to run constant fight with cold] and screams via Google Home Minis + on Telegram, that I need to close the door so Skynet could bring back the heat
when the home is empty, my Xiaomi MiJia Robot starts cleaning at 1p.m., Telegram notifies me on every problem that occurs and also after successfull cleaning I got the stats & report [time, battery, total area, brush/sensor status - do I need to replace/clean them etc.]
reports me when my wife, and my wife when I - go out of work and gives ETA to home considering current traffic.
I have set the “importance” level for every notification, and then via dashboard me & my wife can set what importance levels do we need to be notified when away/at home - so for example I can mute the less important ones when I’m at home, or mute everything etc.
the triggered ones are mostly the report ones - so:
I have the “main” keyword /report - when given alone it shows me a Telegram-message-buttons-menu with options, I can tap/click them or I can give commands like /report lights etc. the screenshot is in my native language - but it’s just to get you know what I’m talking about these reports give me status about which lamp is turned on, what scene is on, gives me info about vacuum [similar like one after the cleaning], it can show me current snapshot from one of my 3 cameras [living room, door, garage], and my last project - it shows me current watermeter readouts.
map locations - /where name shows map & location of user name
/weather [tomorrow|week] gives current or when based weather forecast
/script name gives me possibility to test scripts that I’m working on
/vacuum [clean|usage|start|stop|dock] are for vacuum control
aaand few more, but you should get the point [the commands above are translated to english for the sake of forum, but I have it in my native language of course].
most of them are well… just for fun, so I can show my friends that “I’m talking with my home via telegram” and they’re not used so often, but it is a cool space to excercise yaml scripting
target is just a telegram id of user that was asking bot for report. the rest is using this schema: “EMOTICON LABEL:/command”. each line in yaml is a new button line in telegram chat, and if I want a couple of buttons in line I just put them after a comma.