#Help with Blueprint which has multiple devices to be triggered by specific device

1 messages · Page 1 of 1 (latest)

tight nebula
#

I just typed this out but apparently it was too long. I will try to keep this brief:

  1. I modified and am using this blueprint here: https://community.home-assistant.io/t/zooz-zen30-double-switch-automation-helper/281362/6?u=muddro
  2. Main changes were to allow multiple devices (I have 3 zen30s that I want to do the same thing)
  3. I have an automation in the blue print to dim or brighten some fan lights when the paddle is held down
  4. An example of the automation would be as follows:
      - repeat:
          sequence:
            - data:
                brightness_step_pct: 10
              target:
                entity_id:
                  - light.office_lamp_group
              action: light.turn_on
            - delay:
                hours: 0
                minutes: 0
                seconds: 0
                milliseconds: 200
          until:
            - condition: not
              conditions:
                - condition: state
                  entity_id: event.bedroom_controller_scene_001
                  attribute: event_type
                  state: KeyHeldDown
        alias: Dimmer Up```
#
  1. The problem I am facing is when a blue print has more than 1 device. For this automation to work, the until section, specifically the entity_id, would need to match the one for the specific device.
#
  1. I am not sure what I should do in this situation so the automation knows which device I am using and to know when the until should stop.
#
  1. For reference, this is my trace log for this automation:
  - 224cfe8144745d2d15adb44cb89d9384
  - f40419b470709a0c3f8315154938c6de
  - 51fd07239ec4ea16dfddb4ab1d6a1554
this:
  entity_id: automation.pool_fan_controllers
  state: 'on'
  attributes:
    id: '1731357425487'
    last_triggered: '2024-11-20T03:47:08.408603+00:00'
    mode: single
    current: 0
    friendly_name: Pool Fan Controllers
  last_changed: '2024-11-20T03:46:30.725075+00:00'
  last_reported: '2024-11-20T03:47:08.662873+00:00'
  last_updated: '2024-11-20T03:47:08.662873+00:00'
  context:
    id: 01JD3TWNZQJG4WSMAM8KDQBPSC
    parent_id: 01JD3TWNZ22XRSE0AGT4CASPPC
    user_id: null
trigger:
  id: '0'
  idx: '0'
  alias: null
  platform: event
  event:
    event_type: zwave_js_value_notification
    data:
      domain: zwave_js
      node_id: 59
      home_id: 3310557397
      endpoint: 0
      device_id: 51fd07239ec4ea16dfddb4ab1d6a1554
      command_class: 91
      command_class_name: Central Scene
      label: Scene 002
      property: scene
      property_name: scene
      property_key: '002'
      property_key_name: '002'
      value: KeyHeldDown
      value_raw: 2
    origin: LOCAL
    time_fired: '2024-11-20T03:47:13.736915+00:00'
    context:
      id: 01JD3TWV68PFG697SNYN054AX2
      parent_id: null
      user_id: null
  description: event 'zwave_js_value_notification'```
willow carbon
#

What is your current status, did you find help or do you still need help?

tight nebula
#

Still need help if possible

#

I hope what I wrote up made sense

willow carbon
#

Just to start, the original BP I assume would have worked, but you would have needed to run 3 automations on the same BP base code, do you agree?

#

That is one of the 2 main intents of Blueprints. 1, share with others. 2, reuse the same code in your system.

#

Basically what I am asking is did you try it as the author sent it out first, did it work as intended to start with.

tight nebula
#

Yes the original blueprint worked fine. And the blueprint still does work fine for most automations and key presses since the are only dependent on a keypress or multiple keypresses

#

So it's agnostic as to which switch does it

#

But in the situation i find myself is in trying to use an "until" loop until a keypress is released, which I would need to specify which specific device keypress is released

#

So I guess I'm wondering if trigger variables work in this situation and would need some help probably

willow carbon
#

I have the original code and can only guess at your code.
trigger_variables are needed for any variables that are needed in the trigger. They will exist at the time of trigger, where regular variables are empty before the trigger.

#

That are populated at the time of trigger.

#

Trigger_variables are limited, which means that not everything can exist before the trigger and that stuff won't work at all in a trigger. Mostly those are the things stored in the state machine. Anything talking about states usually can't be a trigger_variable.

tight nebula
#

The code I normally used on single switches is in #4 above. Basically using the entity id event.controler_scene_01. what I would like to know is in a blueprint, am I able to use a trigger variables to populate that entity id somehow