0.0.34 • Published 2 years ago

homebridge-filebased-contactsensor v0.0.34

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

homebridge-filebased-contactsensor

A filebased contact sensor for Homebridge

This plugin sensor monitors the modification time of an "open file" and a "closed file" to determine the state of a door.

For background, this is my way of kludging together integration of a yolink door sensors into homekit.

My particular setup relies on several interconnected components:

  1. Yolink Door sensors https://shop.yosmart.com/collections/featured/products/outdoor-contact-sensor
  2. IFTTT recipes that connects with yolink. I append to an open or closed file hosted on dropbox when receiving the corresponding event from yolink.
  3. Synology Cloudsync synchronizing my dropbox account
  4. Homebridge running as a docker container on a Synology NAS. I present the synchronized dropbox folder to the docker container
  5. Finally this plugin

Configure the plugin as follows:

  {
        "name": "Patio Gate",
        "openpath": "/yolink/devices/patiogate/open.txt",
        "closedpath": "/yolink/devices/patiogate/closed.txt",
        "accessory": "DoorSensor"
    }
    
    

The logic works as follows:

  • If neither the openpath or closedpath file exist, then the door is closed
  • If only the open file exists, then the door is open
  • If only the closed file exists, then the door is closed
  • If both files exist, then compare the last modification time. The most recently modified file reflects the current state of the door.

I poll the status of the files every 1/2 second.

--

Lots of improvements to make, especially around building the config properly.

Enjoy.

0.0.34

2 years ago

0.0.33

2 years ago

0.0.32

2 years ago

0.0.31

2 years ago

0.0.30

2 years ago

0.0.29

2 years ago

0.0.28

2 years ago

0.0.27

2 years ago

0.0.26

2 years ago

0.0.25

2 years ago

0.0.24

2 years ago

0.0.23

2 years ago

0.0.22

2 years ago

0.0.21

2 years ago

0.0.20

2 years ago

0.0.19

2 years ago

0.0.18

2 years ago

0.0.17

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago