GithubHelp home page GithubHelp logo

Comments (25)

i3laze avatar i3laze commented on August 16, 2024 1

vijaydembla1, please post your plugin config and tell the MQTT-device you're using.

+1 for garage setup seems really messy.

For example:

  1. GetState and SetState both use one 'doorvalues' array, but I've got separate MQTT topics for control and state with non-matching status names.

  2. When I set "doorValues" variable in config, MQTT logging shows that only a first char was published, like 'O', instead of 'ON'. Currently I have to modify index.js for publish to work fine.

  3. When State is 'Open' and a door is suddenly closed by RF remote or embedded autoclose timer, contact sensor fires event; MQTT logging says ' State is now: 1',
    nevertheless HomeKit state changes from 'Open' to 'Opening'.
    How so? Maybe something like this is required?

UPD: I moved to this GarageDoor plugin - it worked for me out of the box.

from homebridge-mqttthing.

arachnetech avatar arachnetech commented on August 16, 2024 1

My <comments in settings> have caused a certain amount of confusion, so I've started changing the format.

As discussed in the pull request, your suggestions were very helpful. I was wrong in my belief that target state couldn't be changed outside HomeKit. The Home App doesn't like to show it when it changes, but closing and re-opening it does show a new externally-set target state. Version 1.0.15 now supports external setting of target states for garage door and security system.

from homebridge-mqttthing.

arachnetech avatar arachnetech commented on August 16, 2024

There was an error in the documentation - default target state values are O for OPEN and C for CLOSED (not 0 and 1). I'll correct this in the next release.

If you customise the values with doorValues, the OPEN and CLOSED target values must currently match the OPEN and CLOSED state values.

I've tested door values with strings longer than the single-character defaults and they seem to work for me. The syntax is:

"doorValues": [ "Open", "Closed", "Opening", "Closing", "Stopped" ]

Logging shows:

[2018-8-12 18:43:11] [Test Garage Door] Received MQTT: test/garage/current = Closed
[2018-8-12 18:43:11] [Test Garage Door] State is now: 1
[2018-8-12 18:43:29] [Test Garage Door] Received MQTT: test/garage/current = Open
[2018-8-12 18:43:29] [Test Garage Door] State is now: 0

MQTT logging of "State is now: 1' is referring to the internal homekit values, not the published MQTT values.

@vijaydembla1 I'm not quite sure what you mean by "the relay topic doesn't trigger the relay button, not sure what I'm missing, as the same relay is working with the Toggle function".

Note that I'm just exposing Homekit behaviour here. The supported behaviour appears to be (only) that Homekit changes the target state to open/closed to indicate whether the door should be open or closed, then the garage door can optionally send Opening/Closing followed by Stopped or Open/Closed to confirm that it has obeyed Homekit's instructions. As far as I can tell, there's no way for a garage door to tell homekit that it has been opened/closed independently of homekit.

from homebridge-mqttthing.

hejsiri avatar hejsiri commented on August 16, 2024

Can you show your configuration for Garage Door Opener?

from homebridge-mqttthing.

arachnetech avatar arachnetech commented on August 16, 2024

I was testing with:

    {
      "accessory": "mqttthing",
      "type": "garageDoorOpener",
      "name": "Test Garage Door",
      "url": "http://192.168.10.35:1883",
      "logMqtt": true,
      "topics":
      {
          "getCurrentDoorState":      "test/garage/current",
          "setTargetDoorState":       "test/garage/target",
          "getObstructionDetected":   "test/garage/obstruction",
          "getLockCurrentState":      "test/garagelock/current",
          "setLockTargetState":       "test/garagelock/target"
      },
      "doorValues": [ "Open", "Closed", "Opening", "Closing", "Stopped" ]
    },

from homebridge-mqttthing.

vijaydembla1 avatar vijaydembla1 commented on August 16, 2024

{
"accessory": "mqttthing",
"type": "garageDoorOpener",
"name": "TEST_Garage",
"url": "mqtt://192.168.1.15",
"username": "",
"password": "
*******",
"caption": "<label (optional)>",
"topics":
{
"getCurrentDoorState": "cmnd/Sensor/POWER2",
"setTargetDoorState": "cmnd/Garage/POWER1",
"getObstructionDetected": "",
"getLockCurrentState": "<topic used to get lock current state (optional)>",
"setLockTargetState": "<topic used to set lock current state (optional)>"
},
"doorValues": "O,o,,,,",
"lockValues": "<array of 4 lock values corresponding to unsecured, secured, jammed and unknown respectively (optional)>",
"integerValue": "true to use 1|0 instead of true|false for obstruction detected value"
},

The above is my config for the garage.
Please note: - I have also added 2 accessories, one for the door status and one to control the relay button, their topics are identical to the one above and they seem to work properly, It's just the garage is always open in homekit, when i press it, it says closing, but i don't see any effect on relay (the toggle).

Please let me know if i'm missing something.

Below is the sensor reading when the door switch moves on esp8266 console.

:_

When in the switch is close to each other:-

13:01:19 MQT: cmnd/Sensor/POWER2 = OFF

When they are seperated:-

13:01:32 MQT: cmnd/Sensor/POWER2 = ON

Thanks

from homebridge-mqttthing.

arachnetech avatar arachnetech commented on August 16, 2024

I would recommend removing the settings with < ... > (getLockCurrentState, setLockTargetState, lockValues, integerValue) as they might confuse things. Those are just intended as comments in the ReadMe.

As far as I can tell, HomeKit's Garage Door (like it's Security System) mandates that HomeKit controls the state that it should be set to, and the door is expected to respond once it's obeyed the command to confirm that HomeKit's state has been reached. It may be possible to set up your switch by setting up and automation in homekit to make the switch change the target state of the garage door. However, you can't just tell homekit that the state has changed, because it will always assume that the door should be moving to homekit's target state.

from homebridge-mqttthing.

Kepete avatar Kepete commented on August 16, 2024

@vijaydembla1 As I see you are also trying to use a esp flashed with tasmota for your garage door. Could I ask what setup are you running?
I have connected two contact sensors and a relay to the tasmota. Now I would like to have a closed mqtt topic and a separate open mqtt topic. Becaouse tasmota gives me the state of one contact sensor and the state of the other.

from homebridge-mqttthing.

hejsiri avatar hejsiri commented on August 16, 2024

I also want to do just like you. Two reed sensors + relay on tasmota. Can you help?

from homebridge-mqttthing.

arachnetech avatar arachnetech commented on August 16, 2024

Could you publish to the same MQTT topic from both contact sensors when they transition as follows:

When closed sensor no contact -> opening
When open sensor contact -> open
When open sensor no contact -> closing
When closed sensor contact -> closed

from homebridge-mqttthing.

brefra avatar brefra commented on August 16, 2024

I would recommend removing the settings with < ... > (getLockCurrentState, setLockTargetState, lockValues, integerValue) as they might confuse things. Those are just intended as comments in the ReadMe.

As far as I can tell, HomeKit's Garage Door (like it's Security System) mandates that HomeKit controls the state that it should be set to, and the door is expected to respond once it's obeyed the command to confirm that HomeKit's state has been reached. It may be possible to set up your switch by setting up and automation in homekit to make the switch change the target state of the garage door. However, you can't just tell homekit that the state has changed, because it will always assume that the door should be moving to homekit's target state.

Pull request #28 contains the fix to keep the GarageDoor device in HomeKit in sync when the door has been controlled from outside of Homebridge.

from homebridge-mqttthing.

transistorgit avatar transistorgit commented on August 16, 2024

Hi, I'm using MQTTThing for all my devices, great!
Now I'm switching over my MQTT-controlled gateway door (same as a garage door) to use also mqttthing.
It works nice so far, but it seems that the "opening"/"closing" states are interchanged in the homekit view, when the door is triggered externally. When triggered by homekit, all states are showing correct order: Door open - touch it - closing - closed. But when its open an I hit the external button, homekit shows "opening" and than "closed" as the final state. The same when it is closed. Hitting the external button - homekit shows "closing", final state is open.

I checked the Mqtt traffic in parallel. It looks completely correct. TargetDoorState shows "Closing", but homekit shows "opening" at the same time (when triggered externally, as said).

Here's my config:
{
"accessory": "mqttthing",
"type": "garageDoorOpener",
"name": "Toreinfahrt",
"url": "http://192.168.168.112:1883",
"topics":
{
"setTargetDoorState": "Toreinfahrt/Target",
"getTargetDoorState": "Toreinfahrt/TargetFeedback",
"getCurrentDoorState": "Toreinfahrt/Status",
"setLockTargetState": "Toreinfahrt/LockTarget",
"getLockTargetState": "Toreinfahrt/unused",
"getLockCurrentState": "Toreinfahrt/unused",
"getObstructionDetected": "Toreinfahrt/unused"
},
"doorValues": [ "Open", "Closed", "Opening", "Closing", "Stopped" ],
"lockValues": [ "Unsecured", "Secured", "Jammed", "Unknown" ]
}

TargetFeedback will only show the values "Open" and "Closed".
Status will show all states "Open", Closed", "Opening", "Closing", "Stopped" exactly written like that.

By the way: homekit doesn't show "stopped", but switches to "Open". Is this Homekit behaviour?

Please tell me what I can do to resolve this, or if I should open a new issue.
best regards

from homebridge-mqttthing.

arachnetech avatar arachnetech commented on August 16, 2024

The Home App doesn’t appear to handle changes in target state correctly. It seems to read the target state when it is opened but then not update it subsequently. If the state then changes to something other than this initial target state, the Home App then shows that the accessory is ‘moving towards’ the initial target state that it read (when really it is moving in the other direction). When I first saw this behaviour, I assumed that target state could only be changed by HomeKit itself. However, if you close then re-open the Home App after changing the target state, it shows the correct state.

from homebridge-mqttthing.

transistorgit avatar transistorgit commented on August 16, 2024

Ok, that explains why I also saw correct target states sometimes. Hopefully Apple will fix that at some time. Thank you and have a nice sunday!

from homebridge-mqttthing.

TLCary avatar TLCary commented on August 16, 2024

"I don't think so Tim." I use MQTTThing for everything but the Garage Door. I would like to use it for everything, but.. I use mqttgaragedoor because it works just fine. It's not Apple or the Home App that isn't responding to changes in the device from external inputs.

from homebridge-mqttthing.

arachnetech avatar arachnetech commented on August 16, 2024

I need to try this mqttgarage door...

from homebridge-mqttthing.

arachnetech avatar arachnetech commented on August 16, 2024

Reopening to remind me to look at https://github.com/iomax/homebridge-mqttgaragedoor.

from homebridge-mqttthing.

peteroz12 avatar peteroz12 commented on August 16, 2024

Hi there, I'm trying to get my Garadget (https://community.garadget.com/t/mqtt-support/3226/5) to work, it seems to open but not close or get the correct status. My config is:

{
"bridge": {
"name": "Ozone Garage",
"username": "XX:XX:XX:XX:XX:XX",
"port": XXXXX,
"pin": "XXX-XX-XXX"
},
"description": "Testing Garage Door",
"platforms": [],
"accessories": [{
"accessory": "mqttthing",
"type": "garageDoorOpener",
"name": "Garage Door",
"url": "http://XXX.XXX.XXX.XXX:1883",
"logMqtt": true,
"topics": {
"setTargetDoorState": "garadget/Door/command",
"getTargetDoorState": "garadget/Door/status",
"getCurrentDoorState": "garadget/Door/command",
"getObstructionDetected": "garadget/Door/status"
},
"doorValues": ["open", "closed", "opening", "closing", "stopped"]
}]
}

Is there something I'm doing wrong?

from homebridge-mqttthing.

TLCary avatar TLCary commented on August 16, 2024

from homebridge-mqttthing.

pasna avatar pasna commented on August 16, 2024

Hi, Best wishes for the coming New Year 2019 everyone. Your plugin is great and I just complete configure all my lightings, I have tested, they work great, I really appreciate your hard work. Now I am working on using Sonoff SV flashed Tasmota 6.4.1, I configure the device as follow -
GPIO5 -> Switch2 connect to reed switch - one reed switch only.

PulseTime1 10
SwitchMode1 1
SwitchMode2 2
PowerOnState 0
PowerRetain 1
SwitchTopic 0

status read -
20:08:24 MQT: stat/frontgatetest/STATUS = {"Status":{"Module":3,"FriendlyName":["Front_Gate_Test"],"Topic":"frontgatetest","ButtonTopic":"0","Power":0,"PowerOnState":0,"LedState":1,"SaveData":1,"SaveState":1,"SwitchTopic":"0","SwitchMode":[1,2,0,0,0,0,0,0],"ButtonRetain":0,"SwitchRetain":0,"SensorRetain":0,"PowerRetain":1}}

rule1 read -
on switch2#state=1 do publish test/garage/current %value% endon on switch2#state=0 do publish test/garage/current o endon

config file -
{
"accessory": "mqttthing",
"type": "garageDoorOpener",
"name": "Front Gate Test",
"url": "http://192.168.0.55:1883",
"username": "my_name",
"password": "my_password",
"logMQtt": true,
"caption": "Front Gate Test",
"topics": {
"setTargetDoorState": "cmnd/frontgatetest/POWER",
"getTargetDoorState": "test/garage/current",
"getCurrentDoorState": "test/garage/current"
},
"doorValues": [
"1",
"1",
"o",
"c",
"S"
],
"lockValues": []
}
with is setting, I am able to get the device trigger 1 second pulse and control my sliding gate to open and close without any problem regardless of how Home App display status. However I felt that this plugin is fascinating and I love to use fewer plugins. At current status these cases were what I had faced.
pt 1) I cannot use other doorValues than what shows above otherwise sonoff will not trigger, I found that "1" will command sonoff to trigger, "o" , "c", "S" did not push Home App to reflect status correctly. The app will spin forever and showing either opening or closing.

pt 2) I have to configure GPIO5 -> Switch2 and put reed switch into the play, reed switch does not control any relay. With reed switch and rule1 I can put the app to come to "Closed" position ( On Home App ). I attach this reed switch to the gate and I got notification pop-up on iPhone when gate is opened or closed and it is perfect. However when I manually, without push on the App Icon, opening the gate and the reed switch move apart, Home App showing closing instead of opening ! I wish it shows "Open" instead.

pt 3) When I restart Homebridge, the plugin fail to retain LWT and the Icon show "Open" but does not trigger relay. This only affect the garage door icon not the lightings.

Have a great holiday.

from homebridge-mqttthing.

vijaydembla1 avatar vijaydembla1 commented on August 16, 2024

Hi All,

I managed to get it to work, all i need is the pulse time to be included. Below is my current config:-

{
"accessory": "mqttthing",
"type": "garageDoorOpener",
"name": "garage-test",
"url": "mqtt://192.168.1.15",
"username": "pi",
"password": "WWWWWWWW",
"caption": "test-garage",
"topics":
{
"setTargetDoorState": "cmnd/Garage/power3",
"getTargetDoorState": "cmnd/2/POWER2",
"getCurrentDoorState": "cmnd/2/POWER2"
},
"doorValues": ["OFF", "ON" ,"o" ,"c" ,"S" ]
}

I have 4 relays and 1 reed switch connected. I need help in adding pulse time to relay 3 only (garage/power3.

I have been able to add all of them and with added pluse time, i'll be able to set up my garage.
Sorry i have been away and it took ages for me to recall what i orginially did.

Thanks again

from homebridge-mqttthing.

NorthernMan54 avatar NorthernMan54 commented on August 16, 2024

from homebridge-mqttthing.

vijaydembla1 avatar vijaydembla1 commented on August 16, 2024

The config needs 2 improvements:-
a) The relay should be timed for a second or so
b) after rebooting either: RaspberryPi, Homebridge. ESP8266
The garage status shows open. You need to physically seperate the reed switch and bring them together to see the correct status in homekit.

Once the above 2 issues have been addressed, then i can upload it to the above link and with various others

Developer of this code might need to help on this :-)

Once again, thanks to all

from homebridge-mqttthing.

tobekas avatar tobekas commented on August 16, 2024

please try Version 1.0.42

from homebridge-mqttthing.

arachnetech avatar arachnetech commented on August 16, 2024

Closing old issue.

from homebridge-mqttthing.

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.