button-card icon indicating copy to clipboard operation
button-card copied to clipboard

[FR] triggers_update and javascript template

Open aschor opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe. the "triggers_update" configuration does not accept javascript templates, according to the docs. Yet, I would like to update my card on every battery powered SENSOR update (not bynary), even if I add a new sensor in home assistant, and I cannot find a way to :

  • a) create a template group "all_sensors", because home assistant sensors cannot be part of a group or I didn't find the doc
  • b) well, have this card interpret javascript to find programatically what items I want to update from

Describe the solution you'd like triggers_update would ideally interpret javascript templates an interpret some output, like a string representing a list of the entity_ids I want tu update with

Describe alternatives you've considered the only way I found is write mannually all my sensors in the list (in a template), but if I add a new battery powered sensor I'm screwed if I forget to update the list in the config

Additional context the card I'm trying to do (a cleaner view of an auto-entities): image

for now, I'm using this code ... :

        - sensor.ble_battery_xiaomi_mija_temp_hum_1
        - sensor.capteur_fenetre_parents_battery_level
        - sensor.capteur_fenetre_jade_battery_level   
        - sensor.capteur_fenetre_sdb_battery_level    
        - sensor.ble_battery_xiaomi_temp_hum_parents  
        - sensor.galaxy_s9_arnaud_niveau_de_batterie_2
        - sensor.ble_battery_a4c138b62cc4
        - sensor.smoke_rdc_battery_level
        - sensor.smoke_etage_battery_level
        - sensor.smoke_impr3d_battery_level
        - sensor.smoke_sssol_battery_level
        - sensor.tablette_p80_eea_battery_level 

aschor avatar Sep 21 '22 15:09 aschor