Closed rex555 closed 7 years ago
Try change "closedDoorSensorValue": 1
Sent from my iPhone
On Jan 14, 2017, at 16:37, rex555 notifications@github.com wrote:
I am having an issue with the plugin not reading my door state correctly. When it is closed it is fine, when I open it, it sets to open, then immediately sets to closed again. I have tried toggling the closedDoorSensorValue with no effect. Any thoughts?
When the door is open: pi@raspberrypi ~ $ gpio read 12 1
When closed: pi@raspberrypi ~ $ gpio read 12 0
My config: { "bridge": { "name": "Homebridge", "username": "CC:22:3D:E3:CE:30", "port": 51826, "pin": "053-73-874" },
"accessories": [{ "accessory": "RaspPiGPIOGarageDoor", "doorSwitchPin": 7, "closedDoorSensorPin": 12, "closedDoorSensorValue": 0, "doorPollInMs": 4000, "doorOpensInSeconds": 18, "name": "Garage Door" }],
"platforms": [ { "platform" : "LifxLan", "name" : "LIFX" } ] }
[Sun Jan 15 2017 00:23:09 GMT+0000 (UTC)] Homebridge is running on port 51826. [Sun Jan 15 2017 00:23:10 GMT+0000 (UTC)] [LIFX] Online: Entrance 3 [d073d5208bfc] [Sun Jan 15 2017 00:23:10 GMT+0000 (UTC)] [LIFX] Online: Entrance 1 [d073d5206f76] [Sun Jan 15 2017 00:23:15 GMT+0000 (UTC)] [LIFX] Online: Entrance 2 [d073d5208bf3] [Sun Jan 15 2017 00:23:32 GMT+0000 (UTC)] [Garage Door] GarageDoor is CLOSED (1) [Sun Jan 15 2017 00:23:33 GMT+0000 (UTC)] [Garage Door] Setting state to 0 [Sun Jan 15 2017 00:23:33 GMT+0000 (UTC)] [Garage Door] Triggering GarageDoor Relay [Sun Jan 15 2017 00:23:33 GMT+0000 (UTC)] [Garage Door] Turning on GarageDoor Relay, pin 7 = 1 [Sun Jan 15 2017 00:23:34 GMT+0000 (UTC)] [Garage Door] Turning off GarageDoor Relay, pin 7 = 0
Right here [Sun Jan 15 2017 00:23:51 GMT+0000 (UTC)] [Garage Door] Set current state to OPEN [Sun Jan 15 2017 00:23:53 GMT+0000 (UTC)] [Garage Door] Door state changed to CLOSED [Sun Jan 15 2017 00:24:19 GMT+0000 (UTC)] [Garage Door] Setting state to 1 [Sun Jan 15 2017 00:24:34 GMT+0000 (UTC)] [Garage Door] GarageDoor is CLOSED (1) [Sun Jan 15 2017 00:24:35 GMT+0000 (UTC)] [Garage Door] Setting state to 0 [Sun Jan 15 2017 00:24:35 GMT+0000 (UTC)] [Garage Door] Triggering GarageDoor Relay [Sun Jan 15 2017 00:24:35 GMT+0000 (UTC)] [Garage Door] Turning on GarageDoor Relay, pin 7 = 1 [Sun Jan 15 2017 00:24:36 GMT+0000 (UTC)] [Garage Door] Turning off GarageDoor Relay, pin 7 = 0
Right here [Sun Jan 15 2017 00:24:53 GMT+0000 (UTC)] [Garage Door] Set current state to OPEN [Sun Jan 15 2017 00:24:57 GMT+0000 (UTC)] [Garage Door] Door state changed to CLOSED [Sun Jan 15 2017 00:25:07 GMT+0000 (UTC)] [Garage Door] Setting state to 1 [Sun Jan 15 2017 00:26:25 GMT+0000 (UTC)] [Garage Door] GarageDoor is CLOSED (1) [Sun Jan 15 2017 00:31:26 GMT+0000 (UTC)] [Garage Door] GarageDoor is CLOSED (1) [Sun Jan 15 2017 00:31:28 GMT+0000 (UTC)] [Garage Door] Setting state to 0 [Sun Jan 15 2017 00:31:28 GMT+0000 (UTC)] [Garage Door] Triggering GarageDoor Relay [Sun Jan 15 2017 00:31:28 GMT+0000 (UTC)] [Garage Door] Turning on GarageDoor Relay, pin 7 = 1 [Sun Jan 15 2017 00:31:29 GMT+0000 (UTC)] [Garage Door] Turning off GarageDoor Relay, pin 7 = 0
Right here [Sun Jan 15 2017 00:31:46 GMT+0000 (UTC)] [Garage Door] Set current state to OPEN [Sun Jan 15 2017 00:31:46 GMT+0000 (UTC)] [Garage Door] Door state changed to CLOSED [Sun Jan 15 2017 00:32:51 GMT+0000 (UTC)] [Garage Door] GarageDoor is CLOSED (1)
β You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
Same behavior. It does not seem to be reading the sensor properly
You did this part? Export the GPIO pins to be used and set their direction after reboot a. Copy and edit this start script into your /etc/init.d directory. b. Change the values to be the gpio pins that you are using. c. chmod 755 /etc/init.d/garage-door-gpio # this makes the script executable d. sudo update-rc.d /etc/init.d/garage-door-gpio defaults # this will set up the symlinks to run the script on startup. e. sudo /etc/init.d/garage-door-gpio start and verify that your pins are exported by looking in ls /sys/class/gpio/ directory
This is my switch pin:
if [ ! -e /sys/class/gpio/gpio19 ] ; then
echo 19 > /sys/class/gpio/export
success=$?
echo out > /sys/class/gpio/gpio19/direction
echo 1 > /sys/class/gpio/gpio19/active_low
echo 0 > /sys/class/gpio/gpio19/value
fi
And this is my sensor:
if [ ! -e /sys/class/gpio/gpio21 ] ; then
echo 21 > /sys/class/gpio/export
success=$?
echo in > /sys/class/gpio/gpio21/direction
fi
Yeah I export the pins using 'gpio export
I have not even mucked with the startup scripts yet but the commands do the same thing. Switch pin works fine, it is the sensor pin not working properly or at odds with reality
Ok, I think I got it, this is using the BCM pinout table. I had the wrong pin for sensors. Thanks for the help!
My is GPIO19 pin 35 and GPIO21 pin 40
Sent from my iPhone
On Jan 15, 2017, at 16:37, rex555 notifications@github.com wrote:
Yeah I export the pins using 'gpio export out' for the garage door controller pin, and 'gpio export in' for the sensor pin. Which sensor pin num do I usr though? The door pin I was lucky enough to use 7 which is 7 in wPi, 7 Physical and GPIO.7. Which number do I use for the config file for the sensor? Physical, Name, or wPi?
I have not even mucked with the startup scripts yet but the commands do the same thing. Switch pin works fine, it is the sensor pin not working properly or at odds with reality
β You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
You welcome!!!
Sent from my iPhone
On Jan 15, 2017, at 17:02, rex555 notifications@github.com wrote:
Ok, I think I got it, this is using the BCM pinout table. I had the wrong pin for sensors. Thanks for the help!
β You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
@rex555 glad you got it working. Feel free to re-open this issue if you have further problems.
@toshibochan thank you so much for helping people who are having problems. I really appreciate your advice to those trying to get it all working π
@benlamonica thank you!!! If not you guys for make this greats homebridge plugins for us we still just pressing the switches manually!! Thanks and thanks
Now I waiting for some one make fan plugin using relay to connect to may fan remote control
This is example for the ceiling fan remote control and relay. Work with Siri but she don't use homebridge. https://youtu.be/bFAyaKc0ChU
I've actually been wanting to automate my fans..will have to take a look at that.
Let me know when you finish the plugin!!!!
Hey guys, one more question. When I export the pins with gpio the wired garage door button ceases to work, any idea if this is supposed to happen? The hap-nodejs direct implementation I was using before used python to export the pin, trigger it, and unexport the pin each time you asked for an open or close so it was not an issue. Any way to do that here?
Show me your file
Initialization of GPIO pins happens in the init.d script. Make sure you are exporting the pins correctly, if you try to export the relay as 'IN' then it will act like a sensor and not change when you press the button.
Sent via mobile device
On Jan 17, 2017, at 2:03 AM, toshibochan notifications@github.com wrote:
Show me your file
β You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
PATH=/sbin:/bin:/usr/sbin:/usr/bin DESC="Enable GPIO for the Garage Door Module" NAME="garage-door-gpio" SCRIPTNAME=/etc/init.d/$NAME
. /lib/lsb/init-functions
case "$1" in start) log_daemon_msg "Enabling Garage Door GPIO" success=0 if [ ! -e /sys/class/gpio/gpio7 ] ; then echo 7 > /sys/class/gpio/export success=$? echo out > /sys/class/gpio/gpio7/direction fi
if [ ! -e /sys/class/gpio/gpio18 ] ; then
echo 18 > /sys/class/gpio/export
success=$?
echo in > /sys/class/gpio/gpio18/direction
fi
log_end_msg $success
;;
*)
echo "Usage: $SCRIPTNAME {start}" >&2
exit 1
;;
esac
exit 0
eh, that ended up ugly adding the following finally gave me a working system! echo 1 > /sys/class/gpio/gpio7/active_low echo 0 > /sys/class/gpio/gpio7/value
Thanks again for all the assistance.
7 should be your relay and 18 your sensor.
Sent via mobile device
On Jan 17, 2017, at 10:45 PM, rex555 notifications@github.com wrote:
eh, that ended up ugly
β You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
Echoing 1/0 just turns the relay on or off, however that will not work correctly if you are trying to echo out to a pin that's been configured to read and not write (in/out).
I am having an issue with the plugin not reading my door state correctly. When it is closed it is fine, when I open it, it sets to open, then immediately sets to closed again. I have tried toggling the closedDoorSensorValue with no effect. Any thoughts?
When the door is open: pi@raspberrypi ~ $ gpio read 12 1
When closed: pi@raspberrypi ~ $ gpio read 12 0
My config: { "bridge": { "name": "Homebridge", "username": "CC:22:3D:E3:CE:30", "port": 51826, "pin": "053-73-874" },
}
[Sun Jan 15 2017 00:23:09 GMT+0000 (UTC)] Homebridge is running on port 51826. [Sun Jan 15 2017 00:23:10 GMT+0000 (UTC)] [LIFX] Online: Entrance 3 [d073d5208bfc] [Sun Jan 15 2017 00:23:10 GMT+0000 (UTC)] [LIFX] Online: Entrance 1 [d073d5206f76] [Sun Jan 15 2017 00:23:15 GMT+0000 (UTC)] [LIFX] Online: Entrance 2 [d073d5208bf3] [Sun Jan 15 2017 00:23:32 GMT+0000 (UTC)] [Garage Door] GarageDoor is CLOSED (1) [Sun Jan 15 2017 00:23:33 GMT+0000 (UTC)] [Garage Door] Setting state to 0 [Sun Jan 15 2017 00:23:33 GMT+0000 (UTC)] [Garage Door] Triggering GarageDoor Relay [Sun Jan 15 2017 00:23:33 GMT+0000 (UTC)] [Garage Door] Turning on GarageDoor Relay, pin 7 = 1 [Sun Jan 15 2017 00:23:34 GMT+0000 (UTC)] [Garage Door] Turning off GarageDoor Relay, pin 7 = 0
Right here [Sun Jan 15 2017 00:23:51 GMT+0000 (UTC)] [Garage Door] Set current state to OPEN [Sun Jan 15 2017 00:23:53 GMT+0000 (UTC)] [Garage Door] Door state changed to CLOSED [Sun Jan 15 2017 00:24:19 GMT+0000 (UTC)] [Garage Door] Setting state to 1 [Sun Jan 15 2017 00:24:34 GMT+0000 (UTC)] [Garage Door] GarageDoor is CLOSED (1) [Sun Jan 15 2017 00:24:35 GMT+0000 (UTC)] [Garage Door] Setting state to 0 [Sun Jan 15 2017 00:24:35 GMT+0000 (UTC)] [Garage Door] Triggering GarageDoor Relay [Sun Jan 15 2017 00:24:35 GMT+0000 (UTC)] [Garage Door] Turning on GarageDoor Relay, pin 7 = 1 [Sun Jan 15 2017 00:24:36 GMT+0000 (UTC)] [Garage Door] Turning off GarageDoor Relay, pin 7 = 0
Right here [Sun Jan 15 2017 00:24:53 GMT+0000 (UTC)] [Garage Door] Set current state to OPEN [Sun Jan 15 2017 00:24:57 GMT+0000 (UTC)] [Garage Door] Door state changed to CLOSED [Sun Jan 15 2017 00:25:07 GMT+0000 (UTC)] [Garage Door] Setting state to 1 [Sun Jan 15 2017 00:26:25 GMT+0000 (UTC)] [Garage Door] GarageDoor is CLOSED (1) [Sun Jan 15 2017 00:31:26 GMT+0000 (UTC)] [Garage Door] GarageDoor is CLOSED (1) [Sun Jan 15 2017 00:31:28 GMT+0000 (UTC)] [Garage Door] Setting state to 0 [Sun Jan 15 2017 00:31:28 GMT+0000 (UTC)] [Garage Door] Triggering GarageDoor Relay [Sun Jan 15 2017 00:31:28 GMT+0000 (UTC)] [Garage Door] Turning on GarageDoor Relay, pin 7 = 1 [Sun Jan 15 2017 00:31:29 GMT+0000 (UTC)] [Garage Door] Turning off GarageDoor Relay, pin 7 = 0
Right here [Sun Jan 15 2017 00:31:46 GMT+0000 (UTC)] [Garage Door] Set current state to OPEN [Sun Jan 15 2017 00:31:46 GMT+0000 (UTC)] [Garage Door] Door state changed to CLOSED [Sun Jan 15 2017 00:32:51 GMT+0000 (UTC)] [Garage Door] GarageDoor is CLOSED (1)