Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 106084

Help with mapping scenes for telegram bot

$
0
0

Hi all! I’m trying to set up a telegram integration to select scenes for different rooms.
Returning the list of scenes does not go super smoothly yet.
I want them in an inline keyboard, so they will each need to be structured like Friendly Name:/apply_scene scene_id

I can manage to either prefix them with the command:

{{
   scenes
   | map('regex_replace', '^' , '/apply_scene ')
   | list
}}

Replace the id’s with the friendly name:

{{
  scenes
  | map('state_attr', 'friendly_name')
  | list
}}

Or duplicate the id:

{{
  scenes
  | map('regex_replace', '(.*)', '\\1 \\1')
  | list
}}

But I haven’t found a way to have both. Any tips?
Doing this with a loop gives weird results, the telegram add-on does better with lists.

Thanks!

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 106084

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>