iomax / homebridge-mqttgaragedoor

Homebridge accessory plugin that create an HomeKit Garage Door Opener mapped on MQTT topics
Apache License 2.0
8 stars 9 forks source link

Clarification #5

Closed aquadat0r closed 6 years ago

aquadat0r commented 6 years ago

Hi there,

Please can you clarify some of the config parameters. I have a reedswitch connected to my garageopener to detect if it is in an open or closed state. The trigger/switch is very much a push mechanism, push to open, push to close dependent on whether the door is open/closed. Can this be done with this plugin?

Thanks

iomax commented 6 years ago

To understand if this plugins can be good for your case you need to understand if and what information is advertised via MQTT by your garage opener.

aquadat0r commented 6 years ago

@iomax thanks, in summary I have the following topics available on my garagedoor opener and MQTT topics.

publish cmnd/sonoff-gate/POWER ON to open/close garagedoor (this is momentary for 1 sec, like a push button). The stat/sonoff-gate/POWER = ON topic is updated to acknowledge the command but reverts back to stat/sonoff-gate/POWER = OFF after the momentary 1 sec.

As for my reed switch to indicate the state of the garage door, it returns the following: Garagedoor open - cmnd/garagedoor/POWER2 = ON Garagedoor closed - cmnd/garagedoor/POWER2 = OFF

Essentially this is needed as the garagedoor switch is only a toggle ('equavalent of pushing a remote control button') which means it is stateless. The reedswitch enables me to know if the garagedoor is open or closed.

This is my current config but does not behave as expected.

{ "accessory": "mqttgaragedoor", "name": "Garage Door", "url": "mqtt://192.168.1.86", "username": "user", "password": "****", "caption": "Garage Door", "doorRunInSeconds": 5, "topics": { "statusSet": "cmnd/sonoff-gate/POWER", "openGet": "cmnd/garagedoor/POWER2", "closedGet": "cmnd/garagedoor/POWER2", "openValue": true, "closedValue": false, "openStatusCmdTopic": "cmnd/garagedoor/POWER2", "closeStatusCmdTopic": "cmnd/garagedoor/POWER2" } }

iomax commented 6 years ago

I'd try

{ "accessory": "mqttgaragedoor", "name": "Garage Door", "url": "mqtt://192.168.1.86", "username": "user", "password": "****", "caption": "Garage Door", "doorRunInSeconds": 5, "topics": { "statusSet": "cmnd/sonoff-gate/POWER", "openGet": "cmnd/garagedoor/POWER2", "openValue": "ON", } }

two more things :

  1. in cases where only one state (reed)switch is used, the use of "openGet" instead of "closedGet" should be chosen based on the physical positioning of the switch on the port

  2. "doorRunInSeconds" : 5 ( = 5 sec. ) sound to me too fast to real match the door running time .. I'd like to thinks to it as 20 or 30 sec. in real life.

aquadat0r commented 6 years ago

Thanks, worked like a charm. Just to confirm, if a second reed switch is used with a different topic, then both openGet and closedGet should be used?

iomax commented 6 years ago

yes, if you have two switches, one that shows the closed state and one that shows the full open state, you can use the two topics appropriately.

aquadat0r commented 6 years ago

Thanks

i3laze commented 6 years ago

It really helped not to use both openGet and closedGet, when I got one reed switch only :) It also helped to use closedGet, so the accessory status updates instantly when reed actualy senses "Closed".

Great job! I've tried 4 other packages.. Your works out of the box with Sonoff Basic Tasmota + reed on GPIO14!

Please do publish the package on npmjs.com for easy install/update via HomeBridge UI.