Zigfred Uno Blueprint ZHA

Hi there,

I wanted to share my working blueprint for the Swiss Zigfred Uno Light Switch that I created using trial and error. Feel free to use, change and improve it.
Sorry for the description being in German but the switch is probably not used anywhere else anyway.

blueprint:
  name: Zigfred Schalter Konfiguration
  description: Tasten des Zigfred konfigurieren.
    
    Die Anzahl der Tasten muss vorher in der Zigfred-App konfiguriert werden, sonst lösen sie kein Signal aus. Ausserdem sollte für jede einzelne Taste die Doppelklick-Funktion für Home Assistant freigegeben werden.
    
    Es ist ausfallsicherer die wichtigsten Funktionen auf dem Zigfred selbst zu speichern (über die App). Dies bei jedoch eingeschränkter Auswahl (nur Lichter im gleichen Zigbee-Netzwerk)
    
    Mögliche Optionen short_press, double_press, long_press, long_release (nicht in diesem Blueprint) - Die Position der Tasten gilt für eine umgekehrte Aufhängung (LED unten mittig).
  domain: automation
  input:
    zigfred_switch:
      name: Zigfred
      description: Auswahl des Zigfred
      selector:
        device:
          integration: zha
          model: zigfred uno

# Eingaben für Aktionen
    button_1_short_press:
      name: Taste 1 kurzer Druck
      description: Aktion für Tastendruck unten rechts.
      default: []
      selector:
        action: {}
    button_2_short_press:
      name: Taste 2 kurzer Druck
      description: Aktion für Tastendruck oben rechts.
      default: []
      selector:
        action: {}
    button_3_short_press:
      name: Taste 3 kurzer Druck
      description: Aktion für Tastendruck unten links.
      default: []
      selector:
        action: {}
    button_4_short_press:
      name: Taste 4 kurzer Druck
      description: Aktion für Tastendruck oben links.
      default: []
      selector:
        action: {}
    button_1_double_press:
      name: Taste 1 doppelter Druck
      description: Aktion für doppelten Tastendruck unten rechts.
      default: []
      selector:
        action: {}
    button_2_double_press:
      name: Taste 2 doppelter Druck
      description: Aktion für doppelten Tastendruck oben rechts.
      default: []
      selector:
        action: {}
    button_3_double_press:
      name: Taste 3 doppelter Druck
      description: Aktion für doppelten Tastendruck unten links.
      default: []
      selector:
        action: {}
    button_4_double_press:
      name: Taste 4 doppelter Druck
      description: Aktion für doppelten Tastendruck oben links.
      default: []
      selector:
        action: {}
    button_1_long_press:
      name: Taste 1 langer Druck
      description: Aktion für langen Tastendruck unten rechts.
      default: []
      selector:
        action: {}
    button_2_long_press:
      name: Taste 2 langer Druck
      description: Aktion für langen Tastendruck oben rechts.
      default: []
      selector:
        action: {}
    button_3_long_press:
      name: Taste 3 langer Druck
      description: Aktion für langen Tastendruck unten links.
      default: []
      selector:
        action: {}
    button_4_long_press:
      name: Taste 4 langer Druck
      description: Aktion für langen Tastendruck oben links.
      default: []
      selector:
        action: {}

mode: restart
max_exceeded: silent

trigger:
- platform: event
  event_type: zha_event
  event_data:
    device_id: !input 'zigfred_switch'
action:
- variables:
    command: '{{ trigger.event.data.command }}'
- choose:
  - conditions: '{{ command == ''button_1_remote_button_short_press'' }}'
    sequence: !input 'button_1_short_press'
  - conditions: '{{ command == ''button_2_remote_button_short_press'' }}'
    sequence: !input 'button_2_short_press'
  - conditions: '{{ command == ''button_3_remote_button_short_press'' }}'
    sequence: !input 'button_3_short_press'
  - conditions: '{{ command == ''button_4_remote_button_short_press'' }}'
    sequence: !input 'button_4_short_press'
  - conditions: '{{ command == ''button_1_remote_button_double_press'' }}'
    sequence: !input 'button_1_double_press'
  - conditions: '{{ command == ''button_2_remote_button_double_press'' }}'
    sequence: !input 'button_2_double_press'
  - conditions: '{{ command == ''button_3_remote_button_double_press'' }}'
    sequence: !input 'button_3_double_press'
  - conditions: '{{ command == ''button_4_remote_button_double_press'' }}'
    sequence: !input 'button_4_double_press'
  - conditions: '{{ command == ''button_1_remote_button_long_press'' }}'
    sequence: !input 'button_1_long_press'
  - conditions: '{{ command == ''button_2_remote_button_long_press'' }}'
    sequence: !input 'button_2_long_press'
  - conditions: '{{ command == ''button_3_remote_button_long_press'' }}'
    sequence: !input 'button_3_long_press'
  - conditions: '{{ command == ''button_4_remote_button_long_press'' }}'
    sequence: !input 'button_4_long_press'

1 Like

Thank you very much.

I was already buildung my own zigfred blueprint

I would love to use your blueprint. But I have my zigfreds in zigbee2mqtt. Could anyone tell my how I can adapt the blueprint to work wit z2m?

I have solved this by myself and it works. I have copied your blueprint and removed

integration: zha and
model: zigfred uno