当前位置: 首页 > 软件库 > 其他开源 > 物联网 >

homebridge-people-x

授权协议 Readme
开发语言 JavaScript
所属分类 其他开源、 物联网
软件类型 开源软件
地区 不详
投 递 者 谈萧迟
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

NOTE: Since version 0.5 the configuration changed to platform. You must fix your configuration to match the new configuration format.


homebridge-people-x

This is a plugin for homebridge. It monitors who is at home, based on their smartphone being seen on the network recently.If you use the EVE.app you can also see the presence history of every person-sensor (powered by fakegato)

It can also receive webhooks sent by location-aware mobile apps (such as Locative, which can use iBeacons and geofencing to provide faster and more accurate location information.

Installation

  1. Install homebridge (if not already installed) using: npm install -g homebridge
  2. Install this plugin using: npm install -g homebridge-people-x
  3. Update your configuration file. See below for a sample.

Configuration

"platforms": [
    {
        "platform": "PeopleX",
        "threshold" : 15,
        "anyoneSensor" : true,
        "nooneSensor" : false,
        "webhookPort": 51828,
        "cacheDirectory": "./.node-persist/storage",
        "pingInterval": 10000,
        "ignoreReEnterExitSeconds": 0,
        "people" : [
            {
                "name" : "Pete",
                "target" : "PetesiPhone",
                "threshold" : 15,
                "pingInterval": 10000,
                "ignoreReEnterExitSeconds": 0
            },
            {
                "name" : "Someone Else",
                "target" : "192.168.1.68",
                "threshold" : 15,
                "pingInterval": 10000,
                "ignoreReEnterExitSeconds": 0
            }
        ]
    }
]
Parameter Note
threshold optional, in minutes, default: 15
anyoneSensor optional, default: true
nooneSensor optional, default: false
webhookPort optional, default: 51828
cacheDirectory optional, default: "./.node-persist/storage"
pingInterval optional, in milliseconds, default: 10000, if set to -1 than the ping mechanism will not be used
ignoreReEnterExitSeconds optional, in seconds, default: 0, if set to 0 than every enter/exit will trigger state change otherwise the state will only change if no re-enter/exit occurs in specified number of seconds
target may be either a hostname or IP address
name a human-readable name for your sensor

How it works

  • When started homebridge-people will continually ping the IP address associated with each person defined in config.json if pingInterval is not set to -1.
  • With an iBeacon or geofencing smartphone app, you can configure a HTTP push to trigger when you enter and exit your 'home' region. This data will be combined with the ping functionality if used to give this plugin more precise presence data.
  • When a ping is successful the current timestamp is logged to a file (seen.db.json)
  • When a Homekit enabled app looks up the state of a person, the last seen time for that persons device is compared to the current time minus threshold minutes, and if it is greater assumes that the person is active.

'Anyone' and 'No One' sensors

Some HomeKit automations need to happen when "anyone" is home or when "no one" is around, but the default Home app makes this difficult. homebridge-people can automatically create additional sensors called "Anyone" and "No One" to make these automations very easy.

For example, you might want to run your "Arrive Home" scene when Anyone gets home. Or run "Leave Home" when No One is home.

These sensors can be enabled by adding "anyoneSensor" : true and "nooneSensor" : true to your homebridge config.json file.

Accuracy

This plugin requires that the devices being monitored are connected to the network. iPhones (and I expect others) deliberately disconnect from the network once the screen is turned off to save power, meaning just because the device isn't connected, it doesn't mean that the devices owner isn't at home. Fortunately, iPhones (and I expect others) periodically reconnect to the network to check for updates, emails, etc. This plugin works by keeping track of the last time a device was seen, and comparing that to a threshold value (in minutes).

From a very limited amount of testing, I've found that a threshold of 15 minutes seems to work well for the phones that I have around, but for different phones this may or may not work. The threshold can be configured in the .homebridge/config.json file.

Additionally, if you're using a location-aware mobile app to range for iBeacons and geofences, this plugin can receive a HTTP push from the app to immediately see you as present or not present when you physically enter or exit your desired region. This is particularly useful for "Arrive Home" and "Depart Home" HomeKit automations which ideally happen faster than every 15 minutes.

Pairing with a location-aware mobile app

Apps like Locative range for iBeacons and geofences by using core location APIs available on your smartphone. With bluetooth and location services turned on, these apps can provide an instantaneous update when you enter and exit a desired region.

To use this plugin with one of these apps, configure your region and set the HTTP push to http://youripaddress:51828/?sensor=[name]&state=true for arrival, and http://youripaddress:51828/?sensor=[name]&state=false for departure, where [name] is the name of the person the device belongs to as specified in your config under people. Note: you may need to enable port forwarding on your router to accomplish this.

By default homebridge-people listens on port 51828 for updates. This can be changed by setting webhookPort in your homebridge config.json.

Notes

Running on a raspberry pi as non 'pi' user

On some versions of raspbian, users are not able to use the ping program by default. If none of your devices show online try running sudo chmod u+s /bin/ping. Thanks to oberstmueller for the tip.

Running in a docker-environment

On some docker-environments (alpine-based for example) it is possible that the ping does not. Please try to install iptools in this case via apk add iputils --no-cache

Thanks

Thanks to everyone who's helped contribute code, feedback and support. In particular:

  • PeteLawrence - for the plugin which this one is forked from
  • simont77 - for the fakegato-plugin
  • wr - for adding in webhook support.
  • benzman81 - for porting the plugin over to be a Platform and improving how ping and webhooks work together, and numerous other fixes.
 相关资料
  • homebridge-people-plus This is a plugin for homebridge. It monitors who is at home, based on their smartphone being seen on the network recently. Installation Install homebridge (if not already instal

  • Vue2+Node博客平台(注意事项) 目前暂时停止维护,项目是2020年4月写的,有什么问题不懂的可以加群讨论。 后台(Node)在群文件:(qq群)700785102 项目需要一些基础的Vue2和Node技术栈支撑 不要盲目上手 一、首页功能 lg尺寸显示的背景:(PC端)(具体ui布局已经更新了最新的,具体请拉取代码后查看或者浏览我的个人博客地址codelei.cn) md尺寸显示的背景:(

  • 问题内容: 当我填写 标题字段时,看到上述可怕的警告时,我并不感到惊讶 。 我读了几乎所有谈论的话题,或者不确定我是否找到了我想做的正确解决方案。 对不起,我不擅长英语或SQL。 在不擅长两种语言的情况下,如何找到正确的答案? 我决定要问。我不会为down-votes或任何失望。 当我想要答案时,我将尽可能真诚地写下来,以帮助您解决其他任何类似的问题。 I have a table for fri

  • Homebridge 是一个轻量级 NodeJS 服务器,它模拟 iOS HomeKit API,提供从 HomeKit 到“智能家居”设备制造商提供的各种第三方 API 的基本桥接。通过 Homebridge 的桥接,可以让 Siri 控制完全不支持 HomeKit 的设备。 此外 Homebridge 支持插件。

  • homebridge-xiaomi-fan homebridge-xiaomi-fan is a plugin for homebridge which allows you to control Xiaomi Smartmi and Mija Fans! It should work with most smart fans from xiaomi.The goal is to make the

  • homebridge-philipstv-X Homebridge module for Philips TV (with JointSpace enabled) Hint: If you are looking for a homebridge-plugin which supports 2018 philips models checkout this plugin's fork by jeb