Payload should be able to support a list, instead of single value

For a home alarm (and probably for a lot of other cases) would be nice that the payload could be a list of values instead of single value.

Right now I need to define a new trigger for each NFC tag I want to allow to control the alarm, but make much sense to me that I can define a list of payloads instead.

That is how I need to define it right now to support multiple payloads:

- alias: RFID 1 Alarm off
  trigger:
    platform: mqtt
    topic: "home/rfid"
    payload: '4542c35d'
  trigger:
    platform: mqtt
    topic: "home/rfid"
    payload: '4542c321'
  condition:

And that is how I would like it to be:

- alias: RFID 1 Alarm off
  trigger:
    platform: mqtt
    topic: "home/rfid"
      - payload: '4542c35d'
      - payload: '4542c321'
  condition:

Is that something easy to implement? Makes sense to ask for this? As I have a pretty long list of NFC to allow.

You could probably use a template for the payload and check it against an OR statement but even that will get long and drawn out.

there’s probably a way similar to this but I’m not sure if it’s implemented. This would just check the payload against a group.

try this:

- alias: RFID 1 Alarm off
  trigger:
    - platform: mqtt
      topic: "home/rfid"
  condition:
    - condition: template
      value_template: "{{ trigger.payload in ('4542c35d','454c321') }}"
1 Like

That worked, thanks a lot!

1 Like