Coder Social home page Coder Social logo

Comments (39)

iomax avatar iomax commented on September 18, 2024 1

Added Online/Offline detection :

  • offline will follow mqtt "last will and testament" topic and showed as "Not Responding"
  • any activity on <open/closed>Get topic will clear the "Not Responding" state.

from homebridge-mqttgaragedoor.

iomax avatar iomax commented on September 18, 2024 1

"<open/close>StatusCmdTopic" to "force" a feeback by the remote device about the open/closed state.
It will be usefull to keep plugin updated about the door state.

from homebridge-mqttgaragedoor.

iomax avatar iomax commented on September 18, 2024

I dind't find the "code" to put the accessory in the "Not Responding" state.
Let me to study what about at the link.

from homebridge-mqttgaragedoor.

i3laze avatar i3laze commented on September 18, 2024

I'm using 'mqtt-switch-tasmota' too for basic switches/lighting.

The feature request is all about:

"activityTopic": "tele/sonoff/LWT",
"activityParameter": "Online", <- this one depends on locale 

Line 141: https://github.com/MacWyznawca/homebridge-mqtt-switch-tasmota/blob/master/index.js

When mqtt-response != "Online", device is then marked for HomeKit as offline.
This behavior dramatically reduces HomeKit querying, when using several devices.

Otherwise all devices, attached to same Homebridge, may become stuck in Home.app at "Updating" state for 15-30 sec.

from homebridge-mqttgaragedoor.

iomax avatar iomax commented on September 18, 2024

I'm working around it. Not strictly related to the tamota features but inline with the mqtt lwt feature.

from homebridge-mqttgaragedoor.

hejsiri avatar hejsiri commented on September 18, 2024

@Kepete Did you finally make a garage door opener based on the device from the tasmota firmware and sensors or other solutions? I am looking for a working solution all the time and I can not find anything. Will you help me?
example: wemos d1 mini + relay + reed sensor / pir sensor

from homebridge-mqttgaragedoor.

Kepete avatar Kepete commented on September 18, 2024

@iomax I will check the Online/Offline detection in the weekend :)

@mientki Yes I have a working solution running, very happy with it! Thought it was a little tricky.

I have a NodeMCU v2 flashed with Tasmota, one relay, two reed sensors, temp sensor.
The configuration looks like this:
screenshot 2018-10-11 at 12 28 56
Switch1 and switch2 are the reed sensors for door fully open or door fully closed. They need to have relay1 and relay2 also specified, otherwise the Tasmota will not give you a separate MQTT topic. Only the relay3 is an actual relay and is used to open the garage door. Temperature sensor is optional.

Plugin configuration looks like this:

  {
            "accessory": "mqttgaragedoor",
            "name": "Garage door",
            "url": "mqtt://x.x.x.x",
            "username": "usr",
            "password": "pswd",
            "caption": "Garage door",
            "topics": {
                "statusSet": "cmnd/sonoff_garage/POWER3",
                "openGet": "stat/sonoff_garage/POWER2",
                "openValue": "ON",
                "closedGet": "stat/sonoff_garage/POWER1",
                "closedValue": "ON"
            },
            "doorRunInSeconds": "20"
        }

As pointed out here before. You still need the doorRunInSeconds but it updates the state to fully closed or fully open as soon as a switch1 or switch2 hit's ON value.
Make sure when setting up that the values for your reed switches are correct. If not inverse them with Tasmota interface by toggeling ON/OFF.
Should be exactly the same on WeMos. Let me know if you need more help or got it working!

from homebridge-mqttgaragedoor.

hejsiri avatar hejsiri commented on September 18, 2024

Thank you for a quick and comprehensive answer. If you have any questions, they will write to you. Is there another channel of communication with you? Only GitHub?

from homebridge-mqttgaragedoor.

iomax avatar iomax commented on September 18, 2024

@Kepete just a quick check at tasmota wiki but maybe I'd update config in somethings like :

 {
           "accessory": "mqttgaragedoor",
           "name": "Garage door",
           "url": "mqtt://x.x.x.x",
           "username": "usr",
           "password": "pswd",
           "caption": "Garage door",

           "lwt": "/lwt",
           "lwtPayload": "offline",

           "topics": {
               "statusSet": "cmnd/sonoff_garage/POWER3",
               "openGet": "stat/sonoff_garage/POWER2",
               "openValue": "ON",
               "closedGet": "stat/sonoff_garage/POWER1",
               "closedValue": "ON",
  
               "openStatusCmdTopic": "cmnd/sonoff_garage/POWER2",
               "closeStatusCmdTopic": "cmnd/sonoff_garage/POWER1"

           },
           "doorRunInSeconds": "20"
       }

from homebridge-mqttgaragedoor.

Kepete avatar Kepete commented on September 18, 2024

@iomax Thanks for pointing out, but actually I don't understand- what for are these needed?

"openStatusCmdTopic": "cmnd/sonoff_garage/POWER2",
"closeStatusCmdTopic": "cmnd/sonoff_garage/POWER1"

from homebridge-mqttgaragedoor.

hejsiri avatar hejsiri commented on September 18, 2024

@Kepete Does your gateway relay work in pulse mode (pulsetime in tasmota) for example 1 second?

from homebridge-mqttgaragedoor.

Kepete avatar Kepete commented on September 18, 2024

@mientki Oh yes, forgot about that -> Pulsetime3 10

from homebridge-mqttgaragedoor.

hejsiri avatar hejsiri commented on September 18, 2024

I managed to set the accessory. I can finally tell Siri to open the garage door. :-) Everything works well on the desk. Today I mount everything in the garage. Thank you @Kepete for help. You helped me a lot.
I have a question: What are these settings for? How should they be arranged?

"lwt": "OPTIONAL: DOOR OPENER MQTT LAST WILL AND TESTAMENT TOPIC",
"lwtPayload": "lwt Payload"

How do you have it set?

from homebridge-mqttgaragedoor.

iomax avatar iomax commented on September 18, 2024

"lwt", "lwtPayload" as well, will allow the "not responding" state in the Home(kit) apps in case the "door operator" ( Wemos/Tasmota switch in your case, from my understanding) goes off line.

       "lwt": "/lwt",
       "lwtPayload": "offline"

should do the work, but I'm unable to check with a Tasmota enviroment so maybe we have to wait one more feedback by @Kepete

from homebridge-mqttgaragedoor.

hejsiri avatar hejsiri commented on September 18, 2024

will it be correct?

    {
        "accessory": "mqttgaragedoor",
        "name": "Garage door",
        "url": "mqtt://192.168.99.170",
        "username": "***",
        "password": "***",
        "caption": "Garage door",
        "topics": {
            "statusSet": "cmnd/garage/POWER3",
            "openGet": "stat/garage/POWER2",
            "openValue": "ON",
            "closedGet": "stat/garage/POWER1",
            "closedValue": "ON",
            "openStatusCmdTopic": "cmnd/garage/POWER2",
            "closeStatusCmdTopic": "cmnd/garage/POWER1",
            "lwt": "tele/garage/LWT",
            "lwtPayload": "offline"
        },
        "doorRunInSeconds": "20"
    }

from homebridge-mqttgaragedoor.

Kepete avatar Kepete commented on September 18, 2024

@mientki Happy you got it working, but the real person to thank here is @iomax who implements all these features and fixes to the plugin! 🥇
With the LWT option I recommend to wait a little until we have figured it out. Right now you config is incorrect. Look at the examples posted before.

About the LWT option. I just tested it.
There is a problem at startup of Homebridge. After you start Homebridge the state of the accessory in the home app is "No Response".
To get it working I need to restart the Tasmota device which in return then sends the lwt message Online and only then the accessory in the app is showed as online.

from homebridge-mqttgaragedoor.

iomax avatar iomax commented on September 18, 2024

It sound good but please take care that you must put lwt & lwtPayload at the "main level" ( not in "topic": { ... } )

{
    "accessory": "mqttgaragedoor",
    "name": "Garage door",
    "url": "mqtt://192.168.99.170",
    "username": "***",
    "password": "***",
    "caption": "Garage door",
    "lwt": "tele/garage/LWT",
    "lwtPayload": "offline",
    "topics": {
        "statusSet": "cmnd/garage/POWER3",
        "openGet": "stat/garage/POWER2",
        "openValue": "ON",
        "closedGet": "stat/garage/POWER1",
        "closedValue": "ON",
        "openStatusCmdTopic": "cmnd/garage/POWER2",
        "closeStatusCmdTopic": "cmnd/garage/POWER1"
    },
    "doorRunInSeconds": "20"
}

Please keep me updated about the "lwt". With Home app in foreground, you can try it switching off the Wemos and waiting the "not responding" state till the mqtt timeout ( usually somethings like 60 or 120sec. )

from homebridge-mqttgaragedoor.

iomax avatar iomax commented on September 18, 2024

About the LWT option. I just tested it.
There is a problem at startup of Homebridge. After you start Homebridge the state of the accessory in the home app is "No Response".
Do get it working I need to restart the Tasmota device which in return then sends the lwt message Online and only then the accessory in the app is showed as online.

Have you set the "<open/close>StatusCmdTopic" ?
It should force a feedback by the device and avoid the need of the restart.

from homebridge-mqttgaragedoor.

Kepete avatar Kepete commented on September 18, 2024

Didn't had these set. Now works perfectly! Thank you a lot for this awesome plugin.
It is now in everyday use and since it has been very reliable.

My final working configuration:

{
            "accessory": "mqttgaragedoor",
            "name": "Garage",
            "url": "mqtt://x.x.x.x",
            "username": "usr",
            "password": "pswd",
            "caption": "Garage",
            "lwt": "tele/sonoff_test/LWT",
            "lwtPayload": "Offline",
            "topics": {
                "statusSet": "cmnd/sonoff_test/POWER3",
                "openGet": "stat/sonoff_test/POWER2",
                "openValue": "ON",
                "closedGet": "stat/sonoff_test/POWER1",
                "closedValue": "ON",
                "openStatusCmdTopic": "cmnd/sonoff_test/POWER2",
                "closeStatusCmdTopic": "cmnd/sonoff_test/POWER1"
            },
            "doorRunInSeconds": "20"
        },

from homebridge-mqttgaragedoor.

iomax avatar iomax commented on September 18, 2024

I'm glad it's working for you and thanks for your feedback :-)

Out of curiosity, instead of "lwt": "tele/sonoff_test/LWT", have you tried even "lwt" : "/lwt" without success ?

from homebridge-mqttgaragedoor.

Kepete avatar Kepete commented on September 18, 2024

Just "lwt" : "/lwt" didn't work for me

from homebridge-mqttgaragedoor.

iomax avatar iomax commented on September 18, 2024

OK, thanks.

from homebridge-mqttgaragedoor.

hejsiri avatar hejsiri commented on September 18, 2024

One more question: What reed sensors do you use? One of my sensors is not working. Could the length of the wire be about 3 m?

Have you thought about using Sonoff RF Bridge + sensors with two codes?

My sensors look like this:
htb1okpekxxxxxxoaxxxq6xxfxxxr

from homebridge-mqttgaragedoor.

Kepete avatar Kepete commented on September 18, 2024

@mientki I had short wires, so I don't know. Easiest would be to check with shorter wire and see if it works.

from homebridge-mqttgaragedoor.

hejsiri avatar hejsiri commented on September 18, 2024

I came up with an idea. I would like to use this solution to open the barrier in the parking lot.

szlaban

The barrier is located 50 m away. No sensors can be connected. The barrier is opened from a remote control or a button at home. It covers itself for 30 seconds and automatically closes without additional activities. I thought to create a rule in tasmota to switch power1 and power2 states to the opposite for a specified time.

Principle of operation:

opening time = 4 sec
open for = 22 sec
closing time = 4 sec
total time = 30 sec

power1 = ON barrier closed
power2 = ON barrier opened
power3 - relay activated for 1 second (pulsetime3 10)

  1. I press power3
  2. the rule switches the state:
         - power1 from ON to OFF for 30 seconds
         - power2 from OFF to ON for 30 seconds

How to create such a rule in tasmota?

from homebridge-mqttgaragedoor.

iomax avatar iomax commented on September 18, 2024

I can't help on tasmota side anyway, without the option to get the "realtime" feedback by the barrier, I'd try :

"doorRunInSeconds": 4,
"pauseInSeconds" : 22,
"topics": {
        "statusSet":    "cmnd/garage/POWER3"
 }

from homebridge-mqttgaragedoor.

hejsiri avatar hejsiri commented on September 18, 2024

Not working :(

{
           "accessory": "mqttgaragedoor",
           "name": "Szlaban",
           "url": "mqtt://192.168.99.170",
           "username": "",
           "password": "",
           "caption": "Szlaban",
           "lwt": "tele/szlaban/LWT",
           "lwtPayload": "offline",
           "topics": {
               "statusSet": "cmnd/szlaban/POWER3"
           },
           "doorRunInSeconds": "4",
           "pauseInSeconds": "22"
       }

from homebridge-mqttgaragedoor.

iomax avatar iomax commented on September 18, 2024

What happen ?
In home(kit) app it should show "opening" state as soon as you push the "Szlaban" icon and switch to "open" state just after 4 sec., 22sec. later it should automatically show the "closing" state till the "closed" 4sec later.

from homebridge-mqttgaragedoor.

hejsiri avatar hejsiri commented on September 18, 2024

Accessory no response.
img_0233

from homebridge-mqttgaragedoor.

iomax avatar iomax commented on September 18, 2024

What do means "Accessory no response." ?
It's working on daily base in my setup where I've a second gate without any sensor.
I'd try removing the "lwt" param.

from homebridge-mqttgaragedoor.

hejsiri avatar hejsiri commented on September 18, 2024

In the HOME app - see the previous screenshot. When I press, nothing happens.
I do not have the lwt parameter. Show me your configuration.

from homebridge-mqttgaragedoor.

iomax avatar iomax commented on September 18, 2024

Please try removing :

"lwt": "tele/szlaban/LWT",
"lwtPayload": "offline",

from homebridge-mqttgaragedoor.

hejsiri avatar hejsiri commented on September 18, 2024

Without result.

        {
            "accessory": "mqttgaragedoor",
            "name": "Szlaban",
            "url": "mqtt://192.168.99.170",
            "username": "",
            "password": "",
            "caption": "Szlaban",
            "topics": {
                "statusSet": "cmnd/szlaban/POWER3"
            },
            "doorRunInSeconds": "4",
            "pauseInSeconds": "22"
        }

from homebridge-mqttgaragedoor.

iomax avatar iomax commented on September 18, 2024

OK, some more investigation needed.
Let me to check and I'll back as soon as possible.

from homebridge-mqttgaragedoor.

hejsiri avatar hejsiri commented on September 18, 2024

OK, thank you very much.

from homebridge-mqttgaragedoor.

iomax avatar iomax commented on September 18, 2024

Typo found in the code.
Please re-download it and try again.

from homebridge-mqttgaragedoor.

rasgeek avatar rasgeek commented on September 18, 2024

Didn't had these set. Now works perfectly! Thank you a lot for this awesome plugin.
It is now in everyday use and since it has been very reliable.

My final working configuration:

{
            "accessory": "mqttgaragedoor",
            "name": "Garage",
            "url": "mqtt://x.x.x.x",
            "username": "usr",
            "password": "pswd",
            "caption": "Garage",
            "lwt": "tele/sonoff_test/LWT",
            "lwtPayload": "Offline",
            "topics": {
                "statusSet": "cmnd/sonoff_test/POWER3",
                "openGet": "stat/sonoff_test/POWER2",
                "openValue": "ON",
                "closedGet": "stat/sonoff_test/POWER1",
                "closedValue": "ON",
                "openStatusCmdTopic": "cmnd/sonoff_test/POWER2",
                "closeStatusCmdTopic": "cmnd/sonoff_test/POWER1"
            },
            "doorRunInSeconds": "20"
        },

Hi can i use this config with sonoff basic flashed with tasmota ?

from homebridge-mqttgaragedoor.

iomax avatar iomax commented on September 18, 2024

It should work with sonoff basic but some hw hack will be need to get the additional IO pin as available on at the board.

from homebridge-mqttgaragedoor.

rasgeek avatar rasgeek commented on September 18, 2024

It should work with sonoff basic but some hw hack will be need to get the additional IO pin as available on at the board.

Ok thanks, can I use it without open and close sensors ? Fake the response with tasmota rules ?

from homebridge-mqttgaragedoor.

Related Issues (20)

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.