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

cant get status in homebridge #12

Closed DaPeace closed 5 years ago

DaPeace commented 5 years ago

Ive tried to get my garagedoor to the homebridge but i cant get it running. The device is visible in homekit but i dont get the status of the device. I have a tasmota sonoff th16, 1 relay POWER1 and 1 reed-switch POWER8 (closed switch) configured (and i want to add POWER7-> opened switch). At the moment the config looks like this: { "accessory": "mqttgaragedoor", "name": "Doppelgarage", "url": "192.168.0.XXX:1883", "username": "", "password": "", "caption": "Doppelgarage", "lwt": "", "lwtPayload": "lwt Payload", "topics": { "statusSet": "cmnd/garagentor_schliesser/POWER1", "openGet": "cmnd/garagentor_schliesser/POWER8", "openValue": "ON", "closedGet": "cmnd/garagentor_schliesser/POWER7", "closedValue": "ON" }, "doorRunInSeconds": "40", "pauseInSeconds": "600" },

Is there any hint how i could solve that problem? I dont see any topic-requests when i subscribe to everything in mosquitto.

Is it possible that you post a sample-config?

iomax commented 5 years ago

From my understanding, to get feedback by Tasmota you have to use "stat/garagentor_schliesser" topic.

I'd try :

{
"accessory": "mqttgaragedoor",
"name": "Doppelgarage",
"url": "192.168.0.XXX:1883",
"username": "",
"password": "",
"caption": "Doppelgarage",
"lwt": "",
"lwtPayload": "lwt Payload",
"topics": {
     "statusSet": "cmnd/garagentor_schliesser/POWER1",
     "openGet": "stat/garagentor_schliesser/POWER7",
     "openValue": "ON",
     "closedGet": "stat/garagentor_schliesser/POWER8",
     "closedValue": "ON",
     "openStatusCmdTopic": "cmnd/garagentor_schliesser/POWER7",
     "closeStatusCmdTopic": "cmnd/garagentor_schliesser/POWER8"
},
"doorRunInSeconds": "40",
"pauseInSeconds": "600"
},
DaPeace commented 5 years ago

I will check that out in the afternoon. Thanks for the answer.

DaPeace commented 5 years ago

Hello iomax, problem solved. Solution was to set the host correct. Maybe you could change the readme so other people dont have to search that much. the url should be "url" : "mqtt://ipaddress" I did ip:port without the mqtt and this is not working. But now i have the next problem. The reedswitch will not work as expected. This is working: "topics": { "statusSet": "cmnd/garagentor/POWER1" }, This is not working: "topics": { "statusSet": "cmnd/garagentor/POWER1", "closedGet": "stat/garagentor_schliesser/POWER8", "closedValue": "OFF" }, Anyone around here that has a dual-reedswitch-setup and could share his config?

iomax commented 5 years ago

I'd check Tasmota feedback about the switch state against the "openValue" and/or "closedValue" param.

From my memory at https://github.com/iomax/homebridge-mqttgaragedoor/issues/10#issuecomment-429335726 there was a talk about a setup like yours.

DaPeace commented 5 years ago

Hello iomax, still playing arround with those feedback-reed-switches. Could you give me a hint what kind of topic in your homebridge-plugin is triggered when i open the home-app and its refreshing the state? I have no chance to get that state from tasmota so i want to use node-red to give the correct answer.

iomax commented 5 years ago

I'd suggest to check deeply inside the Tasmota config and various SetOption. Since few days I'm using Tasmota too and everything run as expected. Let me to add that I'd start just with one switch ( closed feedback for example ) after then and when everything run as expected, the "upgrade" to the double feedback will be more ease. Regarding node-red, maybe you look at "cmnd/garagentor_schliesser/POWERx" but, honestly, your question was not clear to me.

DaPeace commented 5 years ago

My problem is, that my switches are bouncing a 3 times between on and off when the door is running over the switch. Ive now debounced those switches with node-red and get a clear state. My question is, when i open the app, homekit is asking your plugin for the state of the door with two of the topics i have to configure. And because tasmota is only sending an event when the switch is triggered, it will only get feedback when i open or close the door. Or maybe im wrong and overlooking something? :-/

iomax commented 5 years ago

on Tasmota you'd ask for status feedback trough cmnd//Power, isn't ?

DaPeace commented 5 years ago

if i send an empty message to cmnd/garagentor/POWER1 (the relay) it gives me result "POWER":"OFF". If i send cmnd/garagentor_schliesser/POWER7 or cmnd/garagentor/POWER7 (the switch) i get no answer for the first and Command Unknown for the second topic.. i think thats where my problem is..

iomax commented 5 years ago

From my knowledge Tasmota firmware will not report just the Switches state. To do what you like to do, you must use a sort of "virtual" out port for every switch ( input ). Just for example if you would like to get switch7 state you have to add a "rele7" at unused port. Maybe more clear if you check within Tasmota git/wiki. I'm not sure about "button" instead of "switch" I didn't try it.