#stare_attr usage

1 messages · Page 1 of 1 (latest)

wispy tartan
#

Hi, im trying to save the color state of my led strip, but doesn't work

state_attr('light.triones_7302040014c7', 'rbg_color') 
odd dagger
#

Save it where?

wispy tartan
#

im trying to save it to a variable or a helper

odd dagger
#

Did you put {{ }} double brackets around it?

wispy tartan
#

yup

keen sand
#

Please share the whole automation/script/whatever

wispy tartan
#

automation:

alias: Leds helper
description: ""
triggers:
  - type: changed_states
    device_id: 8d4c223d97995336094b87c4eca47bb5
    entity_id: 725b79f32f95d94c600665d392bb1245
    domain: light
    trigger: device
conditions: []
actions:
  - action: input_text.set_value
    metadata: {}
    data:
      value: "{{ state_attr('light.triones_7302040014c7', 'rbg_color') }}"
    target:
      entity_id: input_text.estado_de_los_led
mode: single
keen sand
#

What does the automation trace show?

wispy tartan
#

maybe im messing up with the attr name?

toxic sapphireBOT
#

When working with templates, don't forget:

  • You can test them in Developer tools -> Templates
keen sand
#

Test the template?

odd dagger
#

Wait... Are you using 2x ' rather than a single " - I don't think it should look like that

wispy tartan
#

wait im so dumb

#

i spelled rbg instead of rgb💀

wispy tartan
#

btw, there is some way to see all attributes of an entity? i discovered rgb_color creating a new card and seeing the code

toxic sapphireBOT
keen sand
#

There