Trigger Templates + Number Template Entities

I am curious if the new number templates can be used as automation.

I have an automation that watches for my family room hue lights when they change brightness and then matches the brightness with my nanoleaf tiles.

alias: Match - (Family Room) Hue brightness to Nanoleaf
description: ''
trigger:
  - entity_id: light.family_room
    platform: state
condition: []
action:
  - data_template:
      brightness: '{{ states.light.family_room.attributes.brightness }}'
    entity_id: light.nanoleaf_group
    service: light.turn_on
mode: single

I attempted to make a new triggered number template entity to do the same thing.

template
  - trigger:
      - platform: state
        entity_id: light.family_room
    number:
      - name: "Match Nano with Hue Brightness"
        state: '{{ ( state_attr("light.family_room", "brightness")) }}'
        step: '{{ 1 }}'
        set_value:
          service: light.turn_on
          target:
            entity_id: light.nanoleaf_group
          data:
            brightness: '{{ value }}'

2021-09-03 14_26_17-Window

This creates a new entity that updates its value in the GUI when the hue lights change.
It also dims the nanoleaf when the GUI it edited.
But it doesn’t seem to pass through the trigger. Meaning the hue lights dont change the nanoleaf lights.

I don’t know if its a limitation of trigger templates, that it doesnt also trigger the “set_value”. Or if I am just doing it wrong.

1 Like