Blueprint Z2M pour Sirène NEO NAS-AB02B2

Hello,

J’ai plusieurs sirènes NEO NAS-AB02B2 sous zigbee2mqtt et je n’arrive pas à setuper les melody, volume et durée lors d’une automatisation.
Ces attributs semblent par défaut, et donc uniques par sirène pour toutes les automatisations utilisant la sirène… pas pratique quand la sirène est utilisée pour une alarme, sonnette, fin de machine à laver… :sweat_smile:

Je me suis donc lancé dans mon premier blueprint !
(étonnamment je n’ai pas trouvé de blueprint existant…)

Et le voici :

blueprint:
  name: Configure and Trigger the NEO NAS-AB02B2 Siren
  description: Dynamically configure alarm, melody, volume, and duration for the siren using Zigbee2MQTT
  domain: automation
  input:
    sirene_entity:
      name: Siren
      description: Entity linked to the siren
      selector:
        entity:
          domain: siren
    melody:
      name: Melody
      description: Select a melody for the siren
      default: 1
      selector:
        select:
          options:
            - "1 - Doorbell"
            - "2 - Für Elise"
            - "3 - Westminster Chime"
            - "4 - Double Quick Doorbell"
            - "5 - William Tell Overture"
            - "6 - Turkish March"
            - "7 - Security/Safe Alarm"
            - "8 - Chemical Spill Alert"
            - "9 - Sharp Alarm Clock"
            - "10 - Fire Alarm"
            - "11 - Dog Barking"
            - "12 - Police Siren"
            - "13 - Doorbell (Reverberation)"
            - "14 - Mechanical Phone"
            - "15 - Firefighter/Ambulance Siren"
            - "16 - Elevator 3/1"
            - "17 - Buzzing Alarm Clock"
            - "18 - School Bell"
    volume:
      name: Volume
      description: Volume level for the siren
      default: high
      selector:
        select:
          options:
            - low
            - medium
            - high
    duration:
      name: Duration
      description: Duration for which the siren stays active (in seconds)
      default: 10
      selector:
        number:
          min: 1
          max: 1800
          step: 1
  action:
    - service: mqtt.publish
      data:
        topic: "zigbee2mqtt/{{ sirene_entity }}/set"
        payload: >
          {
            "melody": {{ melody.split(' - ')[0] }},
            "volume": "{{ volume }}"
          }
    - service: mqtt.publish
      data:
        topic: "zigbee2mqtt/{{ sirene_entity }}/set"
        payload: '{"alarm": true}'
    - delay:
        seconds: "{{ duration }}"
    - service: mqtt.publish
      data:
        topic: "zigbee2mqtt/{{ sirene_entity }}/set"
        payload: '{"alarm": false}'
mode: single

Par contre, catastrophe… j’ai ce message quand je recharge les automatisations :

Invalid blueprint: extra keys not allowed @ data[‹ blueprint ›][‹ action ›]. Got [{‹ service ›: ‹ mqtt.publish ›, ‹ data ›: {‹ topic ›: ‹ zigbee2mqtt/{{ sirene_entity }}/set ›, ‹ payload ›: ‹ {\n « melody »: {{ melody.split(' - ')[0] }},\n « volume »: « {{ volume }} »\n}\n ›}}, {‹ service ›: ‹ mqtt.publish ›, ‹ data ›: {‹ topic ›: ‹ zigbee2mqtt/{{ sirene_entity }}/set ›, ‹ payload ›: ‹ {« alarm »: true} ›}}, {‹ delay ›: {‹ seconds ›: ‹ {{ duration }} ›}}, {‹ service ›: ‹ mqtt.publish ›, ‹ data ›: {‹ topic ›: ‹ zigbee2mqtt/{{ sirene_entity }}/set ›, ‹ payload ›: ‹ {« alarm »: false} ›}}]

Et là, je sèche…
Qu’en pensez-vous ? N’hésitez pas, c’est mon premier :wink:

Voir la solution ici : Sirènes NEO NAS-AB02B2 et automatisations - #8 par Math77