arachnetech / homebridge-mqttthing

A plugin for Homebridge allowing the integration of many different accessory types using MQTT.
Apache License 2.0
467 stars 104 forks source link

Sonoff SV as GarageDoorOpener - Opening state after HB reboot #351

Open Paulxp opened 4 years ago

Paulxp commented 4 years ago

Hi guys, i don't know if it is bug or something wrong in my configuration. My Sonoff SV is flashed with Tasmota firmware 8.5.1. and i use it as garage door opener without any sensors. Because the gate is shared with my other neighbours, i dont need real state info (multiple flats at our building). Relay output is connected to button on dummy remote controller. Technically i simulate pressing of button on remote controller on 3 seconds and auto off (tasmota pulsetimer)

Everything works fine, but the little isssue is when i restart homebridge, Garage Door (Sonoff SV) is in state opening. I have to click on it and then it is in closed state. After that procedure it works normally to another reboot HB or rPi. Is there any option how to set default state after homebridge restart? I need it in state closed.

My config:

{
            "accessory": "mqttthing",
            "type": "garageDoorOpener",
            "name": "Door-G",
            "url": "mqtt://192.168.185.200",
            "username": "sonofka",
            "password": "secretpass",
            "caption": "Door-G",
            "topics": {
                "setTargetDoorState": "cmnd/Door-G/POWER",
                "getTargetDoorState": "stat/Door-G/POWER",
                "getCurrentDoorState": "stat/Door-G/POWER"
            },
            "doorValues": [
                "ON",
                "OFF"
            ],
            "doorTargetValues": [
                "ON",
                "OFF"
            ]
        },
ceraz68 commented 3 years ago

This is normal as the garagdoor opener expects a target state on startup . If it doesn't get one from cmnd/Door-G/POWER it will keep spinning. When you use the remote, it will assign a default target. Lots of old posts about this subject in this forum.

If you don't have any sensors there is no point in using a garagedoor opener as you can't feed it with the appropriate target and current states. Best to use a switch accessory instead to emulate the standard push button wall switch. You can leave leave the pulsetime setting in tasmota.