Git Product home page Git Product logo

Comments (3)

NicoDreamzZ avatar NicoDreamzZ commented on July 19, 2024 1

I gave the triggers all a unique id, and in the actions I use the if and check which trigger was used.

alias: "[Action] [Button] HomeButtons"
description: ""
trigger:
  - platform: device
    domain: mqtt
    device_id: f1c7da1df4e124d045f9b76b9ddf9adf
    type: button_short_press
    subtype: button_1
    discovery_id: HBTNS-2301-180-31FD62 button_1
    id: 1_single
  - platform: device
    domain: mqtt
    device_id: f1c7da1df4e124d045f9b76b9ddf9adf
    type: button_short_press
    subtype: button_2
    discovery_id: HBTNS-2301-180-31FD62 button_2
    id: 2_single
  - platform: device
    domain: mqtt
    device_id: f1c7da1df4e124d045f9b76b9ddf9adf
    type: button_short_press
    subtype: button_3
    discovery_id: HBTNS-2301-180-31FD62 button_3
    id: 3_single
  - platform: device
    domain: mqtt
    device_id: f1c7da1df4e124d045f9b76b9ddf9adf
    type: button_short_press
    subtype: button_4
    discovery_id: HBTNS-2301-180-31FD62 button_4
    id: 4_single
  - platform: device
    domain: mqtt
    device_id: f1c7da1df4e124d045f9b76b9ddf9adf
    type: button_short_press
    subtype: button_5
    discovery_id: HBTNS-2301-180-31FD62 button_5
    id: 5_single
  - platform: device
    domain: mqtt
    device_id: f1c7da1df4e124d045f9b76b9ddf9adf
    type: button_short_press
    subtype: button_6
    discovery_id: HBTNS-2301-180-31FD62 button_6
    id: 6_single
  - platform: device
    domain: mqtt
    device_id: f1c7da1df4e124d045f9b76b9ddf9adf
    type: button_double_press
    subtype: button_3
    discovery_id: HBTNS-2301-180-31FD62 button_3_double
    id: 3_double
condition: []
action:
  - if:
      - condition: trigger
        id: 1_single
    then:
      - service: input_boolean.toggle
        data: {}
        target:
          entity_id: input_boolean.gaste
  - if:
      - condition: trigger
        id: 2_single
    then:
      - event: test.test.test.test
        event_data: {}
  - if:
      - condition: trigger
        id: 3_single
    then:
      - service: cover.open_cover
        data: {}
        target:
          entity_id:
            - cover.405297
            - cover.40528b
  - if:
      - condition: trigger
        id: 3_double
    then:
      - service: cover.close_cover
        data: {}
        target:
          entity_id:
            - cover.405297
            - cover.40528b
  - if:
      - condition: trigger
        id: 4_single
    then:
      - service: script.fix_thermostate
        data: {}
      - delay:
          hours: 0
          minutes: 0
          seconds: 3
          milliseconds: 0
      - service: script.thermostate_eco
        data: {}
  - if:
      - condition: trigger
        id: 5_single
    then:
      - service: script.fix_thermostate
        data: {}
      - delay:
          hours: 0
          minutes: 0
          seconds: 3
          milliseconds: 0
      - service: script.thermostate_komfort
        data: {}
  - if:
      - condition: trigger
        id: 6_single
    then:
      - service: script.thermostate_aus
        data: {}
mode: single

Here some screenshots:
firefox_QuL7H7G1IZ
firefox_wIkZNq2XFH

from homebuttons.

NicoDreamzZ avatar NicoDreamzZ commented on July 19, 2024

I tried building a blueprint, but it seems kinda complicated. The firmware uses mqtt discovery. This creates mqtt device triggers at home assisted. I found no functional way to implement that in a blueprint.

As a simple solution for not having multiple automations, I wrote all triggers into one automation, gave them each a own id and checked later in the conditions.
grafik

If you need it, i can share my yaml code.

from homebuttons.

MatthiasLohr avatar MatthiasLohr commented on July 19, 2024

If you need it, i can share my yaml code.

That would be great. Maybe I can start from there.

from homebuttons.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.