Code Monkey home page Code Monkey logo

hubitat-http-presence-sensor's Introduction

HTTP Presence Sensor for Hubitat

A virtual presence sensor for Hubitat that determines its state by trying to access an HTTP endpoint. If it gets good responses, it reports present. If it gets a few bad responses in a row, it reports not present.

Use Cases

  • Pinging a device (that has an HTTP endpoint) to see if it is on the house's wifi network. If that device is present, then it means someone is home.
  • When running HomeBridge on a Raspberry Pi, sometimes the homebridge process stops responding to HomeKit and Hubitat. Use this virtual device to regularly check and see if HomeBridge is still up and running. If it isn't, you can use Rule Machine rules to cycle the power on the Raspberry Pi. (I have my RPi plugged into a z-wave outlet for this reason.)

Installation

The best way to install this code is by using Hubitat Package Manager.

However, if you must install manually:

  1. Open your Hubitat web page
  2. Go to the "Drivers Code" page
  3. Click "+ New Driver"
  4. Paste in the contents of httpPresenceSensor.groovy
  5. Click "Save"
  6. Go to the "Devices" page
  7. Click "+ Add Virtual Device"
  8. Set "Device Name" and "Device Network Id" to anything you like. Set "Type" to "HTTP Presence Sensor".
  9. Click "Save Device"
  10. On the device list, click the name of your new sensor
  11. Set "Endpoint URL" to the url that you want the sensor to regularly ping. Example: On my HomeBridge setup, the hubitat plugin exposes an endpoint at "http://192.168.1.37:8005/". This is what I enter for the Endpoint URL.
  12. Click "Save Preferences"

hubitat-http-presence-sensor's People

Contributors

joelwetzel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

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.