/ September 30, 2019/ Home Assistant, Uncategorized, Xiaomi/ 0 comments

I made my dumb doorbell smart. First of all we have to make shure there is some integration in Home Assistant. Therefore i made a hack to a Xiaomi Door/Window Sensor.

I desoldered the little contact strip and soldered 2 wires.
I am using a Finder Relais to provide at one side an input of the Doorbell powersupply and at the other site a powerless contact to the sensor.

Finder 40.52.8.012.0000

At last, offcourse the Xiaomi Door/Window sensor is integrated in HA alreay with the Xiaomi Aqara integration, but you can also use Zigbee2MQTT or another Zigbee integration.

My Home Assistant config is as follow. The code is providing a push notification with an video stream of the door camera and also saving a snapshot. At last there is a condition to prevent repeating doorbells when somebody is fast pressing.

- alias: Notify Doorbell
  initial_state: on
  trigger:
    platform: state
    entity_id: 
     - binary_sensor.door_window_sensor_158d00016c3e09  #deurbel
    from: 'off'
    to: 'on'
  condition:
    condition: template
    value_template: '{{ (as_timestamp(now()) - as_timestamp(states.automation.notify_doorbell.attributes.last_triggered | default(0)) | int > 10)}}'
  action:
    - service: camera.snapshot
      data:
       entity_id: camera.frontdoor
       filename: '/config/downloads/camera_snapshots/frontdoor_cam.jpg'
    - service: notify.yourphone
      data:
        title: 'Doorbell'
        message: 'Doorbell: Somebody at the door! - Videostream'
        data:    
          push:
            category: camera
          entity_id: camera.frontdoor
Share this Post

Leave a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>
*
*

4 + fifteen =