Git Product home page Git Product logo

homebridge-http-webhooks's People

Contributors

benzman81 avatar betorn avatar donavanbecker avatar eddyk69 avatar emptygalaxy avatar flyinglemming avatar iens avatar jcbriones avatar jsiegenthaler avatar jwktje avatar kaowiec avatar kovalev-sergey avatar mshulman avatar p-x9 avatar paolotremadio avatar ramset avatar shirnschall avatar supermamon avatar tansuka avatar teslaownertips avatar tiifuchs avatar tritter avatar wr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

homebridge-http-webhooks's Issues

[ERROR Http WebHook Server] No accessoryId in request.

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

Webhook callback problem

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.

Garage door closing - Set delay

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

statelessswitches can not call urls

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

Publish new version?

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.

Issue with window covering

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!

Permission denied - Newbie

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...

Garage Door

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

support commands additional to urls

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

Homekit "spinning wheel" on status change

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.

body as string

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?

Push button cached state not being released

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

Light Intensity example

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

Securing the webhooks

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

Need some help

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!

Ask for current state in Security System

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.

History support

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?

[ERROR Http WebHook Server] No accessoryId in request.

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

Motion Sensor not updating in Homekit

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.

Cannot make the code to work with the most recent updates

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'.

Share thermostatscript.php missing file

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,

airquality sensor status is 'undefined'

Hello,

I have an issue with the airquality sensor. It is not recognized by homekit:

img_1866

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

lockmechanisms not working correctly: open url only

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

Support for Fans

Thanks for the webhooks plugin, can you add support for Fans.

Permission error when running on docker

[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?

Window Covering

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)?

Add as lights

Is it possible to add lights as well (Just like switches, but so they apear as lights in homekit).

Switch activity not correctly recognised in the Home app

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

Disabling callback to url, when change is detected.

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?.

Can't update or re-install :(

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?

IFTTT not working

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

EACCES error when running via launchd on macOS

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)

Connection Refused

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?

Can't initialize accessory when using systemd

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'...

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.