How come I can’t get the value of action level in this blue print?
Shouldn’t this line get the value 228?
“{{ state_attr(‘entity_1’, ‘action_level’) }}”
I can set the value to 228 and it works?
my Device state
{
“battery”: 95,
“linkquality”: 184,
“voltage”: 2900,
“action”: “”,
“action_group”: 108,
“action_color_temperature”: 160,
“action_transition_time”: 0,
“action_level”: 228,
“action_hue”: 85,
“action_saturation”: 254
}
blueprint:
name: One-way synchronize brightness states
description: Synchronize the on/off state of 2 entities, going from source to target entity (but never reflecting updates from target back to source)
domain: automation
input:
entity_1:
name: Source entity
selector:
entity: {}
entity_2:
name: Target entity
selector:
entity: {}
source_url: https://gist.github.com/fireboy1919/997c80db37de30da76f67c5daeaba27b
mode: restart
max_exceeded: silent
variables:
entity_1: !input entity_1
entity_2: !input entity_2
trigger:
- platform: state
entity_id: !input entity_1
- platform: state
entity_id: !input entity_1
attribute: action_level
condition: []
action:
- choose:
- conditions:
condition: template
value_template: "{{ is_state(trigger.to_state.entity_id, 'on') }}"
sequence:
- service: light.turn_on
data:
brightness: 255
entity_id: '{% if trigger.from_state.entity_id == entity_1 %} {{ entity_2 }} {% else %} {{ entity_1 }} {% endif %}'
- choose:
- conditions:
condition: template
value_template: "{{ is_state(trigger.to_state.entity_id, 'brightness_move_to_level') }}"
sequence:
- service: light.turn_on
data:
brightness: "{{ state_attr('entity_1', 'action_level') }}"
entity_id: '{% if trigger.from_state.entity_id == entity_1 %} {{ entity_2 }} {% else %} {{ entity_1 }} {% endif %}'
- choose:
- conditions:
condition: template
value_template: "{{ is_state(trigger.to_state.entity_id, 'off') }}"
sequence:
- service: light.turn_off
data:
entity_id: '{% if trigger.from_state.entity_id == entity_1 %} {{ entity_2 }} {% else %} {{ entity_1 }} {% endif %}'`