dubocr / homebridge-gpio-device

Homebridge GPIO device expose several HomeKit accessories interacting with GPIO
Apache License 2.0
65 stars 22 forks source link

ContactSensor triggered by another accessories #116

Open Arfa03 opened 3 years ago

Arfa03 commented 3 years ago

Hi there, I’m running Homebridge single instance on a RaspiB3+, the actual configuration was perfectly running until i’ve updated all the system, plugin, node and so. Now, all is working, but i have a strange issue. I’ve two contactsensor and one motionsensor configured in my config.json, now, after the updating, it will triggered if i turn on a light from tasmota switch that is mqtt-linked to other one, or if i turn on the gpio pin that i use for turn on the motion sensor. Is strange because it not is really triggered, but seems that the trigger event is caused by a reverse of the behaviour of the pin. If the door is closed as example, when i open the door, the sensor says that is open. But if i turn on the tasmota switch that turn on the light, the sensor says instantly that the door is closed. Strangeness: if i close the door, the contact sensor says the door is open, until i turn another one off and on the tasmota switch, and the behaviour of the pin is now newly inverted, and the contact sensor says closed. In the gpio-readall, all works ever like a charm, door open pin stays on “1”, door closed pin stays on “0” status. I’m stuck on this, any help is appreciated. I’ve tried to remove the plugin and reinstall, with no effect. I’ve tried in surplus to connect a 10kohm pullup resistor, but obviously the problem not is caused from the physical pin. What can i do?

Arfa03 commented 3 years ago

For now, i’m solved it by migrating all contact sensor to another plugin, i’m still waiting for a solution for this case. If anyone have the same problem, the plugin that now i use for the contact sensor, is homebridge-contactsensor via npm.

coshy81 commented 3 years ago

Hi there, I can also confirm that the PIN allocations for this GPIO mod has changed from using the wPI number to the BCM number.

gpio-readall helped me understand which pin was what (as you mentioned above), here is a sample of the changes I had to make:

{ "accessory": "GPIODevice", "name": "Gate", "type": "GarageDoorOpener", "pins": [ 27, (was wPi 2..) 22 (was wPi 3..) ], "openingDuration": 15, "closingDuration": 15 }

I must add, i'm still using version v0.4.7, I'm yet to update to v0.4.9 for fear of this great mod breaking again on me, every time I update I seem to have to fix something..

Arfa03 commented 3 years ago

Hi there, I can also confirm that the PIN allocations for this GPIO mod has changed from using the wPI number to the BCM number.

gpio-readall helped me understand which pin was what (as you mentioned above), here is a sample of the changes I had to make:

{ "accessory": "GPIODevice", "name": "Gate", "type": "GarageDoorOpener", "pins": [ 27, (was wPi 2..) 22 (was wPi 3..) ], "openingDuration": 15, "closingDuration": 15 }

I must add, i'm still using version v0.4.7, I'm yet to update to v0.4.9 for fear of this great mod breaking again on me, every time I update I seem to have to fix something..

Hi, i’ve not remembered to say that i made this change, obvious. My problem is not caused from pin numbering, that is correct, but from some things that cause “interference” in the code, i think. Might be the migration to the new gpio control.

coshy81 commented 3 years ago

no problem, have you tried to re-install the wiringPi using: sudo apt-get install wiringpi?

also, I upgraded to version v0.4.9 and my code is still functional

Arfa03 commented 3 years ago

Hi, yes i’ve tried also to reinstall all common plugin, anyway, if i don’t say dumbness, the versions above 0.4.7 use onoff instead of wPi. I’ve just now tried the latest release of the plugin, but the problem is still there.

InZan3 commented 2 years ago

I have the same problem twice, on my Pi Zero the lights trigger Motion Sensors and on the 3B+ open pin for Garage Door not working anymore. Version 0.4.3 works without Problems. PIN numbers were changed for Update

Arfa03 commented 2 years ago

@InZan3 i’ve solved all of my problem by completely switch all the system to homeassistant, has a more strong community.

InZan3 commented 2 years ago

@Arfa03 i want to stay at home bridge