Make a dumb doorbell smart with Shelly 1

I also noticed the same issue that the automation was not triggered on a very short press when the trigger in the automation is set on the entity for the shelly switch. This is solved by using MQTT, I use the automation below.

It will only trigger if the previous trigger was more than 5 seconds ago.

alias: Doorbell push notifcation
description: ''
trigger:
  - platform: mqtt
    topic: shellies/doorbell/input/0
    payload: '1'
condition:
  - condition: template
    value_template: >-
      {{ (as_timestamp(now()) -
      as_timestamp(states.automation.doorbell_notification.attributes.last_triggered
      | default(0)) | int > 5)}}
action:
  - choose:
      - conditions:
          - condition: state
            entity_id: switch.doorbell_chime
            state: 'off'
        sequence:
          - service: notify.notify
            data:
              message: Someone at the door (chime off)
              title: Doorbell
              data:
                ttl: 0
                priority: high
                color: red
    default:
      - service: notify.notify
        data:
          message: Someone at the door (chime on)
          title: Doorbell
          data:
            ttl: 0
            priority: high
            color: green
3 Likes