#Setting a value to trigger.entity_id as variable

22 messages · Page 1 of 1 (latest)

sudden flint
#

I'm trying to set a number by using the {{ trigger. entity_id }} and appears to not be working. thoughts?

- id: invalid_value_error_for_tuya_presence_sensor
  alias: 'Invalid Value Error for Tuya Presence Sensors'
  mode: restart
  trigger:
  - trigger: state
    entity_id: number.0xa4c1384aa4fb469f_presence_sensitivity
    to:
    - '0'
    - 'unknown'
    - 'unavailable'
  condition: []
  actions:
    - action: number.set_value
      data:
        value: "2"
      target:
        entity_id: "{{ trigger.entity_id }}"
blissful dew
#

what is it doing if not the right thing?

#

"appears to not be working" is difficult for anyone to help

sudden flint
# blissful dew what is it doing if not the right thing?

i'm trying to safeguard against this bug https://github.com/Koenkk/zigbee2mqtt/issues/24049 as the value of this entity random goes to "0" and then generates tons of the following errors:

 Invalid value for number.0xa4c13824c58f12f0_presence_sensitivity: 0 (range 1.0 - 10.0)

I'm trying to replicate this behavior as it is unpredictable as to when this happens and I use set state in the STATES page under developer to set the state to 0 hoping to trigger the automation and it does not work. Oddly when I set its value to 1 using the number.set_value in ACTIONS (cause the UI wont let me set it 0) then go back to the STATES page to set it to 0 then the automation triggers.

GitHub

What happened? Home Assistant is displaying the errors below, informing that the entity values ​​must be within a range. It turns out that when I set these values ​​to within the range, either in Z...

blissful dew
#

right, but what is it doing?

#

is there an error in the log?

#

you'll need to debug what's going on

sudden flint
#

No error

blissful dew
#

review the trace

#

I doubt that your automation will prevent that log message

sudden flint
#

Yeah I'm uncertain as when it will at all trigger when the bug happens

#

the whole point using the STATE page and setting the state to zero was to test it

blissful dew
#

if Z2M is setting the entity to an incorrect state, that's what's causing the log message. Fixing it later isn't going to make the log message go away

sudden flint
#

yeah you

#

you're probably right

blissful dew
#

if you just want to filter that log message, you can do that in the logger integration

sudden flint
#

really?

blissful dew
#

really

astral pathBOT
sudden flint
#

guess i will look at that

blissful dew
#
  filters:
    homeassistant.components.sensor.recorder:
      - ".*last_reset set to.*"
#

for example