benzman81 / homebridge-http-webhooks Goto Github PK
View Code? Open in Web Editor NEWA http plugin with support of webhooks for Homebridge: https://github.com/nfarina/homebridge
License: GNU General Public License v3.0
A http plugin with support of webhooks for Homebridge: https://github.com/nfarina/homebridge
License: GNU General Public License v3.0
Hello,
I use homebridge-knx, how can i use your plugin to handle light etc from my homebridgeknx ?
Thanks in advance,
Gil
Hello - I've started randomly getting these errors in my homebridge log. I haven't changed any configuration. Could you help me diagnose these further - how can I tell where the request is coming from and what the content (or lack of) is?
Thanks in advance,
Paul
I tested 0.0.25, for the issue where a webhook change would trigger a on/off event. And at first glance i thought that your change solved the issue.
But after further investigation (Testing on 0.0.26). I can see that it don't seem to solve the problem anyway.
The way it behave right now can cause a loop between homekit and my home control system.
The reason for this is that when my home controller sends a webhook change, your program seems to update homekit, and then send the on/off url command.
Is it possible to add an option to the webhook, so it only updates homekit, but don't send the on/off url calls. I know that it propably is not what this plugin was intended for, but maybe it could be a nice feature for this plugin, so it can be used for reflecting states of another system in homekit.
Great plugin. I've got a motion sensor HomeKit trigger working great with my kitchen lights. Could you please add door sensors?
More info here: KraigM/homebridge-wink#42
Hi!
Thanks for an awesome plug-in! :) 👍
Would it be possible to add support for the Stateless Programmable Switch service type?
https://github.com/KhaosT/HAP-NodeJS/blob/9eaea6df40811ccc71664a1ab0c13736e759dac7/lib/gen/HomeKitTypes.js#L3384
TIA,
David
is there any way I can set a delay for how long the garage opener shows opening or closing state before updating to the targetdoorstate
Currently it only displays for ~3 sec
Hello
I will try to use the statelessswitch for Sonos (API) volume.
Example: http://192.168.1.xxx:5005/office/volume/+5
but how can set the event in the statelessswitches?
"statelessswitches": [
{
"id": "statelessswitch1",
"name": "Stateless Switch 1",
"buttons":[ //the buttons of the switch
{
"name": "Button1"
},
{
"name": "Button2",
"double_press": false, //you can disable a type of action
"long_press": false
}
]
}
],
Greeting
I was getting errors while trying to implement occupancy sensors, when I realized that the version published to the NPM repo doesn't yet have these. I installed the current master
instead, and it seems to work just fine.
Hello all,
I have setup a window covering accessory as follow:
"id": "windowcovering1", "name": "Store Bureau", "open_url" : "http://myURL", "open_method" : "GET", "close_url" : "http://myURL", "close_method" : "GET"
Via the Home app, when I tap on the blind icon to set the blind up, it works: the icon shows open and the physical blind goes up.
My issue is when I tap on the blind icon to set the blind down, it does not work as expected: the physical blind goes down, but the icon shows "closing" with a spining wheel running forever.
What am I doing wrong?
thanks in advance!
First of all - Thanks for the Plugin!
I wanted to setup a motion sensor
Config
{
"platform": "HttpWebHooks",
"webhook_port": "51828",
"sensors": [{
"id": "sensor2",
"name": "Eingang",
"type": "motion",
"cache_directory": "/var/homebridge/persist/",
"autoRelease": true
}]
}
Log
Getting current state for 'sensor2'...
State for 'sensor2' is 'undefined'
But if I want to send a state http://192.168.178.80:51828/?accessoryId=sensor2&state=true
Error: EACCES: permission denied, open '/.node-persist/storage/6fa6149f73dba66bcb0cfbe76fde5a94'
at Object.openSync (fs.js:443:3)
at Object.writeFileSync (fs.js:1194:35)
at LocalStorage.persistKeySync (/usr/local/lib/node_modules/homebridge-http-webhooks/node_modules/node-persist/src/local-storage.js:460:16)
at LocalStorage.setItemSync (/usr/local/lib/node_modules/homebridge-http-webhooks/node_modules/node-persist/src/local-storage.js:251:14)
at HttpWebHooksPlatform. (/usr/local/lib/node_modules/homebridge-http-webhooks/index.js:415:34)
at IncomingMessage.emit (events.js:203:15)
at endReadableNT (_stream_readable.js:1145:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
Got SIGTERM, shutting down Homebridge...
I currently have a wifi momentary relay to activate a garage door by url trigger (using webhooks pushbutton) and a wifi sensor attached to the garage door to send url status (using webhooks sensor). Would it be possible to combine the webhooks sensor function with the webhooks push button function into a webhooks garage door function (with a single open/close status and push to trigger garage door icon in homekit)? I have seen this combined function in the homebridge wemo plugin for the wemo relay.
thanks
Hello, may I suggest to add also commands (curl, php etc) not only http requests to turn on or off elements on homekit? As the plugin homebridge-cmdSwitch2 works, it could be great to have "on_cmd" and "off_cmd" instead of "on_url" and "off_url", a mix between commands and webhooks for notifications could be awesome.
Thanks
Hi.
First of all, thank you for your plugin, it's great !
I've got an issue with the garage door and security system accessories.
I configured one of each of them in my HomeBridge setup, and I'm using a custom RestAPI to command my garage door and security system.
Actions are OK (when I tap the garage button in HomeKit, the garage door opens and the security system takes the right state and goes in the right state when I choose the state in HomeKit), but the HomeKit button then has the "spinning wheel" indicating the action is still running indefinitely.
Does your plugin waits for a code returned to it for validating the status has changed ? Or a callback maybe ?
Thanks.
Hi,
I have a JSON body that I want to include in a POST request, but since the body needs to be a string, this is messing up my config. Can we allow the body as an object?
Calling the web hook for a push button works the 1st time, then the “true” state is cached on the node_persist/storage directory
I have to change it to false manually in order to make it work again
I am not able to send accessoryId with capital I
The client application sends all URLs in lowercase.
Is there an parameter for case insensitivity?
Thanks
Wolfgang
Hello !
Can you help posting a light intensity example in config? like a window covering please? I'm having some trouble with it !
Thanks !!
very useful plugin
Could I use this with https://github.com/jishi/node-sonos-http-api to trigger playlists etc?
Is there any way we can add user/pass auth to the webhooks?
Concerned that anyone with the correct URL could control my house!
Thanks,
Paul
hey,
could you please update the dependencie of the request
plugin?
homebridge-http-webhooks/package.json
Line 30 in bbc2a68
"npm audit" fails because you fixate the version.
thanks :)
How can I GET the current state of the garage door
When I do "http://localhost:51828/?accessoryId=garagedoor1" this is the reposnse I get
Could you add a Security System to the devices? That would be great.
Need a little assistance. I have homebridge up and running great. I am trying to send the webhooks however I am little confused where to add the config.json file. I already have one under ".homebridge" location. Do I need to update that config file with some of the examples and then add my IP address? I've tried to send some local webhooks but I don't get anything to happen. How does it know what specific device I am wanting to target (shade, light or whatever it may be)?
Here is one of requests
http://192.XXX.X.X:port/?LivingShade=LivingShade&targetposition=80
I get nothing in return.
Any assistance would be great. Thanks!
now that homekit supports TV accessory type any plans to add the device type
Hi, is there a way to ask the current state of a security system? Currently it works for the switches, the motion sensors (by omitting the state=)...but not for the security system, it just returns "success: true".
It would be awesome if somebody added this.
Is it possible to add the history support (like fakegato) so we can use Eve or other third-party controller to monitor the history of certain values, such as temperature?
Hi,
Most deff a noob error but for some reason I am unable to post the url to change the state of a switch. I get the error in the title.
Here is an extract of my config:
"platform": "HttpWebHooks",
"webhook_port": "51828",
"cache_directory": “/var/homebridge/persist”,
"switches": [{
"id": "KeepAlive",
"name": "KeepAliveSwitch"
The url I'm posting is http://publicip:51828/?KeepAlive=KeepAliveSwitch&state=true
Any ideas where i'm going wrong? I thought the accessoryid would be: KeepAlive and the accessory id to trigger would be: KeepAliveSwitch
Thanks in advance
Thanks for this great plugin. It works very well with my smart home using homee (https://hom.ee)!
Is it possible to use shutters with the plugin, instead of switches, so that I can say: Hey Siri, open or close the garage door?
Up_url /down_url instead of on_url / off_url? Other icons, like for a garage door?
Thanks a lot.
Support brightness/dimmer.
I have created a motion sensor. Using curl, I set it status to 'true'. I can see that it changes in the homebridge. But the status does not update in the homekit app. If I exit the app and reload, status updates to show 'true'. If I then set it to 'false' it again changes in homebridge but not homekit. Again a restart of the homekit app will update the status of the sensor correctly.
Hi I did a fresh install of everything. update nodejs, homebridge, and etc to the recent versions they have. Unfortunately, i installed this and it looks like it doesn't work as expected. I did use the npm command to install this plugin. Tried without any accessories and still causes an error. It looks like it is causing software while initializing the accessories but the plugin loaded successfully.
Error I am getting from my current config.
Jun 19 06:33:48 raspi3 systemd[1]: Started Node.js HomeKit Server.
Jun 19 06:33:50 raspi3 homebridge[6705]: [2018-6-19 06:33:50] Loaded config.json with 2 accessories and 3 platforms.
Jun 19 06:33:50 raspi3 homebridge[6705]: [2018-6-19 06:33:50] ---
Jun 19 06:33:50 raspi3 homebridge[6705]: [2018-6-19 06:33:50] Loaded plugin: homebridge-camera-ffmpeg-omx
Jun 19 06:33:50 raspi3 homebridge[6705]: [2018-6-19 06:33:50] Registering platform 'homebridge-camera-ffmpeg-omx.Camera-ffmpeg-omx'
Jun 19 06:33:50 raspi3 homebridge[6705]: [2018-6-19 06:33:50] ---
Jun 19 06:33:51 raspi3 homebridge[6705]: [2018-6-19 06:33:51] Loaded plugin: homebridge-http-securitysystem
Jun 19 06:33:51 raspi3 homebridge[6705]: [2018-6-19 06:33:51] Registering accessory 'homebridge-http-securitysystem.Http-SecuritySystem'
Jun 19 06:33:51 raspi3 homebridge[6705]: [2018-6-19 06:33:51] ---
Jun 19 06:33:51 raspi3 homebridge[6705]: [2018-6-19 06:33:51] Loaded plugin: homebridge-http-webhooks
Jun 19 06:33:51 raspi3 homebridge[6705]: [2018-6-19 06:33:51] Registering platform 'homebridge-http-webhooks.HttpWebHooks'
Jun 19 06:33:51 raspi3 homebridge[6705]: [2018-6-19 06:33:51] Registering accessory 'homebridge-http-webhooks.HttpWebHookSensor'
Jun 19 06:33:51 raspi3 homebridge[6705]: [2018-6-19 06:33:51] Registering accessory 'homebridge-http-webhooks.HttpWebHookSwitch'
Jun 19 06:33:51 raspi3 homebridge[6705]: [2018-6-19 06:33:51] Registering accessory 'homebridge-http-webhooks.HttpWebHookPushButton'
Jun 19 06:33:51 raspi3 homebridge[6705]: [2018-6-19 06:33:51] Registering accessory 'homebridge-http-webhooks.HttpWebHookLight'
Jun 19 06:33:51 raspi3 homebridge[6705]: [2018-6-19 06:33:51] Registering accessory 'homebridge-http-webhooks.HttpWebHookThermostat'
Jun 19 06:33:51 raspi3 homebridge[6705]: [2018-6-19 06:33:51] Registering accessory 'homebridge-http-webhooks.HttpWebHookOutlet'
Jun 19 06:33:51 raspi3 homebridge[6705]: [2018-6-19 06:33:51] ---
Jun 19 06:33:51 raspi3 homebridge[6705]: [2018-6-19 06:33:51] Loaded plugin: homebridge-lockitron
Jun 19 06:33:51 raspi3 homebridge[6705]: [2018-6-19 06:33:51] Registering accessory 'homebridge-lockitron.Lockitron'
Jun 19 06:33:51 raspi3 homebridge[6705]: [2018-6-19 06:33:51] ---
Jun 19 06:33:53 raspi3 homebridge[6705]: [2018-6-19 06:33:53] Loaded plugin: homebridge-platform-insteonlocal
Jun 19 06:33:53 raspi3 homebridge[6705]: homebridge API version: 2.2
Jun 19 06:33:53 raspi3 homebridge[6705]: [2018-6-19 06:33:53] Registering platform 'homebridge-platform-insteonlocal.InsteonLocal'
Jun 19 06:33:53 raspi3 homebridge[6705]: [2018-6-19 06:33:53] ---
Jun 19 06:33:53 raspi3 homebridge[6705]: [2018-6-19 06:33:53] Loading 3 platforms...
Jun 19 06:33:53 raspi3 homebridge[6705]: [2018-6-19 06:33:53] [Camera-ffmpeg-omx] Initializing Camera-ffmpeg-omx platform...
Jun 19 06:33:53 raspi3 homebridge[6705]: [2018-6-19 06:33:53] [HttpWebHooks] Initializing HttpWebHooks platform...
Jun 19 06:33:53 raspi3 systemd[1]: homebridge.service: Main process exited, code=exited, status=1/FAILURE
Jun 19 06:33:53 raspi3 systemd[1]: homebridge.service: Unit entered failed state.
Jun 19 06:33:53 raspi3 systemd[1]: homebridge.service: Failed with result 'exit-code'.
Hello,
Thanks for this wonderful plugin. I am testing the thermostat device and noticed the thermostatscript.php missing file.
Could you this thermostatscript.php that we can find in the Example config.json?
"set_target_temperature_url": "http://127.0.0.1/thermostatscript.php?targettemperature=%f", // %f is replaced by the target temperature
Regards,
Hello,
I have an issue with the airquality sensor. It is not recognized by homekit:
Here is the the config file:
{
"platform": "HttpWebHooks",
"webhook_port": "51828",
"cache_directory": "./.node-persist/storage",
"http_auth_user": "test",
"http_auth_pass": "test",
"sensors": [
{
"id": "sensor1",
"name": "contact",
"type": "contact"
},
{
"id": "sensor2",
"name": "airquality",
"type": "airquality"
}
]
}
Here is the homebridge log:
[2019-2-25 23:07:20] [HttpWebHooks] Getting current state for 'sensor2'...
[2019-2-25 23:07:20] [HttpWebHooks] State for 'sensor2' is 'undefined'
Could you help me to find the problem?
Regards
Hello, I've used the "lockmechanisms" to control a remote lock by http and receive back the status as following
"lockmechanisms": [
{
"id": "doorlock",
"name": "Main door",
"open_url" : "http://ipaddress/?Id=1&val=0",
"open_method" : "GET",
"close_url" : "http://ipaddress/?Id=1&val=1",
"close_method" : "GET"
}
]
From remote lock I update correctly the status via webhooks (it works well).
The problem is, even if the status is "locked" or "unlocked" (correctly shown by interface) the url sent by the plugin is always the "open_url" , never the "close" one. Just to be clear, if the status is "close" and I click on interface it opens the door, and the status switches on "open", If now I click again to "close" it sends "nothing".
Is it a bug or am I wrong on something?
Rob
Would it be possible to implement a programmable switch event (as implemented within the following plugin: https://github.com/jourdant/homebridge-amazondash-ng) that switches on for a period and then automatically switches off? (i believe the default timeout is 15 seconds)?
Negative values for temperature sensor not working. When temp sensor submit values below zero, sensor display "0"
Hi,
with the current version of Homebridge 0.4.27 the state of the occupancy sensors do not update in Home visually. The actual interface works (true, false, cachedValues).
Thanks for the webhooks plugin, can you add support for Fans.
[9/1/2019, 9:16:26 PM] Error: EACCES: permission denied, mkdir '/run/s6/services/homebridge/.node-persist'
This is fixed by using the proper volume path, "cache_directory": "/homebridge/.node-persist",
for example.
Maybe it should be added to the documentation?
Thanks very much for the garage door function. Would it possible to have similar functionality for garagedoor but using the windowcovering accessory type in homekit (eg for window blinds or curtains)?
Hello,
I can't send a temperature to my Temperature-sensor.
URL:
http://192.168.178.XXX:51828/?accessoryId=sensor1&value=20
What is the correct format for value?
Hi,
is there a way to ask for the current state? If not, please add this feature. Maybe if "state=" is omitted.
Regards
Is it possible to add lights as well (Just like switches, but so they apear as lights in homekit).
Pardon what may be a stupid question, but can I use this with an IFTTT maker channel to change the status of any of my existing accessories in homebridge?
I have a number of ESP8266 devices which I'd like to include in an existing IFTTT recipe to turn everything off when I leave home. At the moment I can only achieve this for the Hue and Wemo lights there are IFTTT channels for. If I could achieve this I'd be super happy!
Thanks in advance.
Paul
I use this great plugin to send on and off events to a http based home control unit.
When the status on the control unit changes, i send a update to webhooks.
That works fine, but then it looks like webhhoks calls the on or off url, so the controller gets the same value once more.
Most of the time this works fine, but the unit is a bit slow, so sometimes this gives unwanted results.
Can you help me with how to disable this callback?.
Tried to update to 0.0.43, then all hell broke loose.
All I get is this;
npm ERR! path /usr/local/lib/node_modules/homebridge-http-webhooks/node_modules/mkdirp/bin/cmd.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/local/lib/node_modules/homebridge-http-webhooks/node_modules/mkdirp/bin/cmd.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/dk/.npm/_logs/2018-12-22T19_43_23_654Z-debug.log
Using node 6.9.1 and npm 6.5.0
Can't install any version now :(
Any suggestions?
Hi There,
Everything i try doen't work.
When i post this URL in browser : http://rpi.oudenes.photography:51828/?accessoryId=sensor4&state=true
it works, when i put this in a IFTTT request to send URL it doesn't show in my logs at all.
Can someone tell me what i do wrong?
Even locative doesnt work as well...
Port 51828 is forwarded to the Homebridge:
Public UDP Ports: 51828
Public TCP Ports: 51828
Private IP Address: x.x.x.x
Private UDP Ports: 51828
Private TCP Ports: 51828
When I run via terminal everything works, but get an EACCES error when running as a daemon via launchd. See log below. Any thoughts on how to run as a daemon?
[2017-8-22 22:07:31] Initializing HttpWebHooks platform...
/usr/local/lib/node_modules/homebridge-http-webhooks/node_modules/mkdirp/index.js:90
throw err0;
^Error: EACCES: permission denied, mkdir '/~/.node-persist'
at Object.fs.mkdirSync (fs.js:891:18)
at sync (/usr/local/lib/node_modules/homebridge-http-webhooks/node_modules/mkdirp/index.js:71:13)
at Function.sync (/usr/local/lib/node_modules/homebridge-http-webhooks/node_modules/mkdirp/index.js:77:24)
at LocalStorage.parseStorageDirSync (/usr/local/lib/node_modules/homebridge-http-webhooks/node_modules/node-persist/src/local-storage.js:600:20)
at LocalStorage.initSync (/usr/local/lib/node_modules/homebridge-http-webhooks/node_modules/node-persist/src/local-storage.js:141:14)
at Object.nodePersist.initSync (/usr/local/lib/node_modules/homebridge-http-webhooks/node_modules/node-persist/src/node-persist.js:37:32)
at HttpWebHooksPlatform (/usr/local/lib/node_modules/homebridge-http-webhooks/index.js:25:18)
at Server._loadPlatforms (/usr/local/lib/node_modules/homebridge/lib/server.js:294:32)
at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:80:36)
at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:40:10)
at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (module.js:573:30)
at Object.Module._extensions..js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)
Hi,
I've successfully loaded the plug-in onto my QNAP homebridge.
However, when I tried to use Curl to trigger state change, the server responded with "Connection Refused". I cannot figure out why. Any ideas?
Hi, guys. Can anyone help me for my situation? When I run out systemd command "homebridge.service", below error message has been always show up and never in-service state.
4月 14 22:26:06 raspberrypi homebridge[7648]: [2019-4-14 22:26:06] [HttpWebHooks] Initializing HttpWebHooks platform...
4月 14 22:26:06 raspberrypi homebridge[7648]: /home/pi/.nvm/versions/node/v10.15.0/lib/node_modules/homebridge-http-webhooks/node_modules/mkdirp/index.js:90
4月 14 22:10:21 raspberrypi systemd[1]: homebridge.service: Main process exited, code=exited, status=1/FAILURE
4月 14 22:10:21 raspberrypi systemd[1]: homebridge.service: Unit entered failed state.
4月 14 22:10:21 raspberrypi systemd[1]: homebridge.service: Failed with result 'exit-code'.
But when I execute "homebridge" command instead systemctl, it doesn't happen. Note that my homebridge is installed other several plugin like philips-hue, broadlink, etc but it hasn't seen this kind of situation.
below is my config.json
{
"platform": "HttpWebHooks",
"webhook_port": "51828",
"pushbuttons": [
{
"id": "pushbutton1",
"name": "push_button1",
"push_url": "my URL", // (optional)
"push_method": "POST" // (optional)
}
]
}
FYI, I could see HttpWebHooks can initialize my accessory when execution with homebridge command.
[2019-4-14 22:08:36] [Philipshue] Initializing Hue platform...
[2019-4-14 22:08:36] [Philipshue] homebridge-hue v0.11.12, node v10.15.0, homebridge v0.4.46
[2019-4-14 22:08:36] [HttpWebHooks] Initializing HttpWebHooks platform...
[2019-4-14 22:08:36] [HttpWebHooks] Initializing platform accessory 'push_button1'...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.