Giter VIP home page Giter VIP logo

homebridge-gpio-device's People

Contributors

andreasprang avatar dubocr avatar mikegoubeaux avatar petaren avatar theofanisv 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

Watchers

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

homebridge-gpio-device's Issues

Loading homebridge-GPIO-device fails

Hey there! I hope you are well!
I am trying to use the type : "LockMechanism" with homebridge-gpio-device but I get this error :

/usr/lib/node_modules/homebridge/lib/api.js:50
  if (name.indexOf('.') == -1) {
          ^

TypeError: Cannot read property 'indexOf' of undefined
    at API.accessory (/usr/lib/node_modules/homebridge/lib/api.js:50:11)
    at Server._loadAccessories (/usr/lib/node_modules/homebridge/lib/server.js:254:42)
    at Server.run (/usr/lib/node_modules/homebridge/lib/server.js:81:38)
    at module.exports (/usr/lib/node_modules/homebridge/lib/cli.js:40:10)
    at Object.<anonymous> (/usr/lib/node_modules/homebridge/bin/homebridge:17:22)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)

I tried homebridge as well as sudo homebridge (as required) but both get the same error.
Here's the complete CLI

pi@raspberrypi:~ $ sudo homebridge
*** WARNING *** The program 'nodejs' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=nodejs>
*** WARNING *** The program 'nodejs' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=nodejs&f=DNSServiceRegister>
[10/8/2017, 2:50:10 AM] Loaded plugin: homebridge-gpio-device
homebridge-gpio-device API version: 2.2
[10/8/2017, 2:50:10 AM] Registering accessory 'homebridge-gpio-device.GPIODevice'
[10/8/2017, 2:50:10 AM] ---
[10/8/2017, 2:50:10 AM] Loaded config.json with 1 accessories and 0 platforms.
[10/8/2017, 2:50:10 AM] ---
[10/8/2017, 2:50:10 AM] Loading 0 platforms...
[10/8/2017, 2:50:10 AM] Loading 1 accessories...
/usr/lib/node_modules/homebridge/lib/api.js:50
  if (name.indexOf('.') == -1) {
          ^

TypeError: Cannot read property 'indexOf' of undefined
    at API.accessory (/usr/lib/node_modules/homebridge/lib/api.js:50:11)
    at Server._loadAccessories (/usr/lib/node_modules/homebridge/lib/server.js:254:42)
    at Server.run (/usr/lib/node_modules/homebridge/lib/server.js:81:38)
    at module.exports (/usr/lib/node_modules/homebridge/lib/cli.js:40:10)
    at Object.<anonymous> (/usr/lib/node_modules/homebridge/bin/homebridge:17:22)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)

and here my config.json :

{
        "bridge": {
                "name": "Homebridge",
                "username": "CC:22:3D:E3:CE:30",
                "port": 51826,
                "pin": "031-66-154",
                "manufacturer": "Homebridge",
                "model": "Homebridge",
                "serialNumber": "0.4.20"
        },

        "description": "Insert description",

        "accessories": [{
                "accesory": "GPIODevice",
                "name": "Porte de l'imeuble",
                "type": "LockMechanism",
                "pin": [1],
                "duration": 10
        }],

        "platforms": []
}

Thank you for your help!

feature request : valve control

Romain! Thanks a lot for your amazing plugin!

Want to advice more functionality. Water valve with several types as HomeKit have them:

  • shower
  • water valve
  • sprinkler
  • tap
    it will be fine to make irrigation system with Raspberry.

Add LockMechanism device

Can you please add a LockMechanism for a front gate latch:
Something like this:

	{
		"accesory": "GPIODevice",
		"name": "Front gate",
		"type": "LockMechanism",
		"pin": 4
		"duration": 2000
	},

The ideia is to unlock the latch (i.e, set the GPIO pin to OUT 0/GND) for a duration of around 2 secs (and then reset it back to IN floating) so a person at the front gate can push the gate open during that time.

P.S.
The LockMechanism ServiceType uses LockCurrentState and LockTargetState characteristics

Motion Sensor Not Refreshing

When the motion sensor is triggered, it's not showing in app. But when I reload app, the motion sensor triggers. And why after the motion sensor triggered, it shows that all time, even if it doesn't triggered.

glass breakage sensor

Hi thanks in advance for this nice work. Worked pretty well.

Is it possible for u to create another accessory type:
I mentioned about a breakage of glass sensor.

For sure it is just working as input with a HIGH signal on a GPIO if the window is intact.
If it is broken singal goes LOW and with this send a notification through apple's home app every minute for example. Best would be adjustable time

Something like that:
"accessory": "GPIODevice",
"name": "Kitchen Window",
"type": "GlassBreakageSensor",
"pin": 5,
"notificationtime": 300

Garage Door Opener don't read open sensor after update

Hi, after plugin update garage door don't read open sensor pin status
I have this config

"accessories": [{
"accessory": "GPIODevice",
"name": "Box",
"type": "GarageDoorOpener",
"pin": 5,
"inverted": true,
"openSensorPin": 12
},

and I have another little problem, if I reboot the system the icon show opening

Shutter control without pulse

my shutters are moving as long as the electricity.
not working with impulse.,
Standar up/down motor control
can you help me

Config.json

Hi,
I’m new with raspberry and all this,
I want to control 2 relay as lock mechanism triggers.
I’ve installed an set up WiFi, Homebridge and your plugin, but I don’t quite get what lines of command I should type when I ssh my Pi to:

  • edit User=root
  • edit config.json to setup my GPIO pin as I’ve wired them and edit the name of the accessory
    Thanks!

Push button request

I have request if possible to do push button for trigger other devices or senes?

Thank you

Garage door opener bug

With door closed if I say “siri close garage” door opens.
This is a problem if I put garage door in “goodnight” scene, goodnight try to close and (if door already closed) opens my garage.

feature request: GarageDoorOpener

my door garage after the opening command closes after 25 seconds, is it possible to insert a time so that in the homekit the status changes from open to closed after a settable time?

Latching relay.

Hi.

Could you by any chance implement a latching relay feature?

I’ve got an normal switch for lighting, witch I would replace with one with a spring.
The switch would be connected to the raspberry, and when I push the physical switch a switch in HomeKit would turn on and vice versa.
So instead of the the state of switch is remembered by a physical switch it would be remembered in software.

This is needed for a software switch and a physical to work together.

/kimovitzh

Run as root

I don't have the file /etc/systemd/system/homebridge.service which I could update with User=root.

So, I tried to run homebride, as root, directly in terminal with sudo homebridge, but my iOS devices dosen't see any of my homebridge devices (which worked perfectly before).

Garage door opener.

Can you add it? with ability to choose number of pins to control gate - one or two. with open\close sensor and garage door eye sensor?

Timeout required even with sensors

Hi,

thanks for the great plugin.
When trying out the GarageDoorOpener I find it works very well except in the cases when the opening or closing motion is interrupted manually (with hardwired switch in garage).
I believe after every setState, or stateChange there needs to be a timeout with the opening/closingDuration. If no Sensor is active (means target is not reached) the state needs to be reset to "Open"

I have played around with something like this, added after line 770, you may use the idea for the various cases. (I am not a seasoned programmer, so this may be quite crude...)

this.shiftTimeoutID = setTimeout(function(){
var closeState = this.closeSensorPin !== null ? wpi.digitalRead(this.closeSensorPin) : this.INPUT_INACTIVE;
var openState = this.openSensorPin !== null ? wpi.digitalRead(this.openSensorPin) : this.INPUT_INACTIVE;
if(openState == this.INPUT_INACTIVE && closeState == this.INPUT_INACTIVE) {
this.log("timeout while closing, reset to open");
this.targetCharac.updateValue(Characteristic.TargetDoorState.OPEN);
this.stateCharac.updateValue(Characteristic.CurrentDoorState.OPEN);
}
this.shiftTimeoutID = null;
}.bind(this), this.closingDuration);

The getState method requires a similar modification to show that the door is "Open" as long as the closed sensor is not active. I added the following if clause (program will never reach your else-clause)

else if(openState == this.INPUT_INACTIVE && closeState == this.INPUT_INACTIVE) {
callback(null, Characteristic.CurrentDoorState.OPEN);

garage door pin sensor not working

thanks for great work. is for good your homebridge can do many kind of devices.
I have garage and gate. relay working okay to open and close the doors, but sensor pin not working. just show closed.

!config.pin fails for pin 0

The test for !config.pin fails for WiringPi pin 0. I substituted !config.hasOwnProperty('pin') and similar for pins and this fixes.

Question on MotionSensor

Hello,

I would like to use MotionSensor but the sensor I am using is inverted, in other words when there is no motion it is in High state.

Is there the possibility to invert the plugin behaviour? Please advise,
Thanks,
Dan

WindowCovering

Bonjour,
c'est encore moi du plugin homebridge Tahoma,
J'ai installé ce plugin afin de contrôler des volets Becker (la centrale domotique becker étant assez chère...). J'ai donc soudé sur des télécommandes et relié aux ports GPIO. Tout fonctionne à merveille. Enfin presque 😀
C'est dans un cabinet dentaire, et donc le personnel ouvre et ferme également les volets. Mon problème est que quand j'ai fermé le volet via homekit, et qu'un employé ouvre le volet avec sa télécommande, homekit le croit toujours fermé, du coup si je demande à siri de fermer le volet, il n'actionne pas le relai, car pour lui c'est déjà fermé.

Serait-ce vraiment trop bourrin, si à la fin de chaque commande d'ouverture ou fermeture homebridge, je mets un SetTimeout de quelques secondes, afin de remettre le currentState à 50% ?
Ou vois-tu une autre solution?

Nothing happens

This is my Code, but when i Push the button, nothing happens.

{ ������������"accessory": "GPIODevice", ������������"type": "MotionSensor", ������������"name": "Hall Motion", ������������"pin": 27 ��������}

I use a contact button on gpio 27 Pin 13 with doorpi and homebridge-contactsensor and it works with an raspi3. But i need a Motion sensor.
Can you help me?

Trouble with on boot switch state

My relays that are setup as switches are on ON after boot. I could be the state of the gpio pins during boot but i'm not sure, Is it possible to control the state via the configs? If not that would be very helpful vs trying to change the gpio pins default state. AWESOME PROJECT THANK YOU.

Is ContactSensor inverted in latest releases?

It seems you changed the default behavior of the ContactSensor

In 0.1.5 the default behaviour was - LOW : sensor triggered, HIGH : sensor not triggered
In 0.2.5 the default behaviour is now - LOW : sensor not triggered, HIGH : sensor triggered

So now in order to get the same bahaviour as before I have to:
"inverted": true

Is this correct?

Refresh sensor status

Too slow. Is any option to change that ? Sensor state is changing only when Homekit app re-read accessories.

support for inverted pin on window covering?

I have a relay that pull opposite, so I would need the inverted option to work for the window covering. I see the key for a few other accessories in the documentation, but it doesnt appear to work on the window covering type.

duration in outlet

Good night,

My name is Pere and I want to know how it would be possible to add “duration” into the function outlet.

Thank you very much,

Pere

Switch feature request

It is possible to have an input pin (optional) to connect an external (physical) button to the gpio? For example controlling a light both from app (home) and from a button.
Thank

SmokeSensor Bug

after updating to version 0.1.8 it does not work anymore, I have configured a smoke sensor in config.json

Lock mechanism

Works fine! But i combine it with tis plugin - https://github.com/Samfox2/homebridge-videodoorbell#readme
How i do that:

  • platform Doorbell with fake trigger button
  • contact sensor from your plugin it is usual doorbell button
    Next we create automation with sensor(connected to simple button) when sensor detect press it pulls trigger(fake button) and we get a message that doorbell rung with snapshot from camera, but i expect two buttons(actionable message) but... nothing. Once when i searching and test some plugin for lock - i get two accessory in homekit for one lock - battery and lock itself. May be adding fake battery to your plugin will help to actionable buttons to work? See that here - https://github.com/jedwood/Apple-Homebridge-Door-Lock#readme
    PS There is one condition for that - video doorbell and lock must be in the same room to work.

Request for node v10 Support

Unfortunately this beloved piece of software can't be build with node v10.

I know it hangs on wiringpi-node but this is unmaintained since more than 2 years an so i have more hope that you are able to find a other solution.

error adding plugin

../ GRC / wiringPi.CC:886:3: note: in expansion of macro EXPORT_CONSTANT_INT ‘
EXPORT_CONSTANT_INT(FSEL_ALT5);
^~~~~~~~~~~~~~~~~~~
WiringPi.purpose.MK: 122: recipe execution error for target ' release / obj parameter.target / WiringPi/GRC / wiringPi.about»
grade: * * * [Release / obj.target / WiringPi/GRC / wiringPi.o] Error 1
to do: exit from directory "/usr/lib/node_modules folder/homebridge ports of the I / o device/folder node_modules/wiringpi-node/gather»
gyp ERR! build error
gyp ERR! stack error: 'make' failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (in/usr/lib in/node_modules/NPM folder/node_modules folder/node-jeep/lib/build.js: 262: 23)
gyp ERR! stack at ChildProcess.to emit (events.js: 182: 13)
gyp ERR! stack in the process.ChildProcess._handle.onexit (internal/child_process.js: 239: 12)
gyp ERR! System Linux 4.14.62-v7+
gyp ERR! command "/usr/bin/node" "directory/usr/lib in/node_modules/NPM folder/node_modules folder/node-jeep/bin / node-jeep.JSC " restore"
gyp ERR! Dov in /usr/lib/node_modules folder/homebridge ports of the I / o device/folder node_modules/wiringpi node
gyp ERR! node-v v10.9.0
gyp ERR! node-gyp -V v3.8.0
gyp ERR! not OK
made.
Enjoy !

please help

Feature Request: Debouncing

Hi
Thanks for your homebridge plugin. I tried using it with a light sensor plugged into the GPIO ports (configured as ContactSensor). It works incredibly fast. Actually, in my case too fast. The light sensor sometimes has some flickering before or after switching. Have you ever though about a debouncing feature, where the input signal has to hold a certain value for some time before actually switching?
Thanks again
Bastian

Issue with pin "0"

Thanks for your code, this looks like it will work well for me.

Typical for me, I used wPi 0 and the script seems to panic and dump out of homebridge. I've tried with "0" (quotes) but no love. Works great with 1 though!

Doorbell integration?

Hey,

would be nice to trigger a "doorbell notification" during a GPIO Pin. Is it possible to do this? Would love to insert a sound sensor into my doorbell and trigger that notification via homekit.

greets from germany!

error to run

please help. I have this error.

/usr/lib/node_modules/homebridge/lib/api.js:64
throw new Error("The requested accessory '" + name + "' was not registered by any plugin.");
^

Error: The requested accessory 'GPIODevice' was not registered by any plugin.
at API.accessory (/usr/lib/node_modules/homebridge/lib/api.js:64:13)
at Server._loadAccessories (/usr/lib/node_modules/homebridge/lib/server.js:286:42)
at Server.run (/usr/lib/node_modules/homebridge/lib/server.js:87:38)
at module.exports (/usr/lib/node_modules/homebridge/lib/cli.js:45:10)
at Object. (/usr/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (internal/modules/cjs/loader.js:799:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:810:10)
at Module.load (internal/modules/cjs/loader.js:666:32)
at tryModuleLoad (internal/modules/cjs/loader.js:606:12)
at Function.Module._load (internal/modules/cjs/loader.js:598:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:862:12)
at internal/main/run_main_module.js:21:11

Question on connecting to pins

Thank you for maintaining this Plug-in and the new updates.

I am sorry for this beginner’s question.

The connection: GND <---> SENSOR <---> PIN does not work for me.

It only works if I connect:

3.3V <---> SENSOR <---> PIN
or
GND <—> SENSOR <---> PIN <---> Resistor <---> 3.3V 

Which way is correct?

I have 2 garage door but sensor pin acting strange.

simulating the issue:
-gate(7) is closed and shop(3) is opened
-press the shop(3) to close
this happens:
[3/12/2019, 3:19:48 PM] [Gate] openSensorPin[7] switch to 0 (inactive) => door closing
[3/12/2019, 3:19:48 PM] [Shop] openSensorPin[3] switch to 1 (active) => door opened
[3/12/2019, 3:19:54 PM] [Shop] openSensorPin[3] switch to 0 (inactive) => door closing
[3/12/2019, 3:19:55 PM] [Gate] Shift ends => door closed
[3/12/2019, 3:20:01 PM] [Shop] Shift ends => door closed

in the app show shop closing and gate show closing even I don't press for gate to close because is closed.

so look like when open or close one door is looking for all door if is closing or opened.

Development proposal

Hi,

Congratulations! This plug-in is working like a charm!
Thank you so much for creating it and making available to the world.

I really like one toolbox to set-up all automation around my house.

Wanted to suggest one enhancement, if this would seem feasible to you.

For example in the Window Accessory type.
It would be great, if it would have option to use two pins to read actual status. For example Windows that I have, have two separate status relays that I can connect to two RPI pins to read - one is active when Window is fully open and other is active when it is fully closed.
That can be used for HomeKit Characteristic (Characteristic.PositionState) to show to user confirmed real final status instead of estimated based on shiftDuration, or also to update initPosition to the real status if fully closed or fully open status is detected upon launch.

Janis

Garage Door Opener stateless autoClose

Hi,

I looked at the GarageDoorOpener autoClose functionality.

If I may, wanted to give two suggestion to improve it.

  1. Opening time and Closing time is not necessarily the same as closing time due to physical motor and environment characteristics can be different. So, it would be better to have possibility to set separately shiftDurationOpening and shiftDurationClosing.
  2. Also, for example in case of my Garden entrance gate there is time of ~45 seconds of it being in Open state, before its automatic closing is starting. So, I would suggest to add one more parameter shiftDurationStayingOpen to program this Open state time & show it in App correctly, before the autoClose is activated.

I'm using currently for this purpose other RPI with an old but working PlugIn (simple-garage-door-opener) than I would love to upgrade to gpio-device.

Janis

"gpio readall" command fails on RPI3B+ with "Oops - unable to determine board type... model: 13"

Hi,

The "gpio readall" command fails on RPI3B+ with this error:

pi@raspberrypi:~ $ gpio readall
Oops - unable to determine board type... model: 13

pi@raspberrypi:~ $ watch -d=comulative -n 0.1 gpio readall
Oops - unable to determine board type... model: 13

It seems that a fix for this is to upgrade the wiringPI to version 2.46
https://www.raspberrypi.org/forums/viewtopic.php?t=208735
http://wiringpi.com/wiringpi-updated-for-the-pi-v3plus/

Your "homebridge-gpio-device" plugin is currently installing/using 2.44

pi@raspberrypi:~ $ cat /usr/lib/node_modules/homebridge-gpio-device/node_modules/wiringpi-node/WiringPi/VERSION
2.44

Can you please update "homebridge-gpio-device" to use wiringPi version 2.46 so we can use the "gpio readall" command to determine the state of the GPIO pins?
Or is there another command to read the GPIO pins?

Thanks,
Miguel

Problem with Wiring Pi

I'm trying now for three days and I always run into the same error:

Dec 29 22:29:03 raspberrypi homebridge[4632]: [12/29/2018, 10:29:03 PM] ====================
Dec 29 22:29:03 raspberrypi homebridge[4632]: [12/29/2018, 10:29:03 PM] ERROR LOADING PLUGIN homebridge-gpio-device:
Dec 29 22:29:03 raspberrypi homebridge[4632]: [12/29/2018, 10:29:03 PM] Error: Cannot find module '../build/Release/WiringPi'
Dec 29 22:29:03 raspberrypi homebridge[4632]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
Dec 29 22:29:03 raspberrypi homebridge[4632]: at Function.Module._load (internal/modules/cjs/loader.js:529:25)
Dec 29 22:29:03 raspberrypi homebridge[4632]: at Module.require (internal/modules/cjs/loader.js:657:17)
Dec 29 22:29:03 raspberrypi homebridge[4632]: at require (internal/modules/cjs/helpers.js:22:18)
Dec 29 22:29:03 raspberrypi homebridge[4632]: at Object. (/usr/local/lib/node_modules/homebridge-gpio-device/node_modules/wiringpi-node/lib/exports.js:1:18)
Dec 29 22:29:03 raspberrypi homebridge[4632]: at Module._compile (internal/modules/cjs/loader.js:721:30)
Dec 29 22:29:03 raspberrypi homebridge[4632]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
Dec 29 22:29:03 raspberrypi homebridge[4632]: at Module.load (internal/modules/cjs/loader.js:620:32)
Dec 29 22:29:03 raspberrypi homebridge[4632]: at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
Dec 29 22:29:03 raspberrypi homebridge[4632]: at Function.Module._load (internal/modules/cjs/loader.js:552:3)
Dec 29 22:29:03 raspberrypi homebridge[4632]: [12/29/2018, 10:29:03 PM] ====================

GPIO connecting issue

OK, so I'm successfully deployed motion detector on GPIO PIN 3, I connected 1 line to PIN 3, but where I had to plug second?? GND? 5V? 3.3V? Pls help me!

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.