HomeKit GarageDoor wrong state

Hello,

i wrote a meross-bridge for my garage door. From openHAB it works perfect, but in Apple Home App I get a message : “Garage Blocked”; “Garage opening” but the garage never switch to open.

My things definition:

Bridge mqtt:broker:broker "MQTT Broker" [ host="localhost", port=1883, secure=false, clientID="meross-bridge-client" ] {
    Thing topic garage_opener_device "Meross Garage Opener" {
        Channels:
            Type string : name         "name"             [ stateTopic="meross/1911087511756090804648e1e91117ac/name"]
            Type switch : doorState    "doorState"        [ stateTopic="meross/1911087511756090804648e1e91117ac/door_state", on="OPEN", off="CLOSED", commandTopic="meross/1911087511756090804648e1e91117ac/set/door_state"]
    }
}

My items definition:

Switch    garage_opener_device_openState     "Garage"    <garagedoor>    (meross)  {channel="mqtt:topic:broker:garage_opener_device:doorState"}

With the REST explorer i got following message from the garage:

{
	"link": "http://openhabiandevice:8080/rest/items/garage_opener_device_openState",
	"state": "OFF",
	"stateDescription": {
		"pattern": "%s",
		"readOnly": false,
		"options": []
	},
	"editable": false,
	"type": "Switch",
	"name": "garage_opener_device_openState",
	"label": "Garage Flo",
	"category": "garagedoor",
	"tags": [],
	"groupNames": [
		"meross"
	]
}

I think i need to change the state value from OFF to CLOSED and the ON to OPEN but i have no idea how i can do that. May be i need a second channel for the State and a switch for OPEN and CLOSE?

I tried a lot but i do not have a solution… sorry for pasting the file into the topic but it was not allowed to add attachments.

Regards

how you item definition including homekit metadata looks like?

Hello…

i add that with the web-gui and used multiple:

GarageDoorOpener,GarageDoorOpener.CurrentDoorState,GarageDoorOpener.TargetDoorState,GarageDoorOpener.Name

Regards Florian

you actually dont need to use name, it is optional current and target door state should be assigned to different items as they have different states.

hello,

can you describe a bit more in detail… may be with a short example, I got the idea but not the exact way.

  • Do I need more than one Item for the door… or how is this done?
  • How can I add more than one “Property” to a item?
  • What do i need to google to find my solution? :slight_smile:

I did try all what came in my mind but I didn’t find a solution jet.

Regards

Hi Florian,

here is an example how it works for me

i configured it using text files but it should work in the same way via UI.

basically you need at least 1 additional item, which can be virtual, i.e. without a link to a channel/things.
something like this.

String garageCurrentState "Garage Current State [%s]" (gGarage) {homekit="CurrentDoorState"}

and the use rules to update you real item, something like this

rule "garage door state update"
when
     Item garage_opener_device_openState received update
then
     if (garage_opener_device_openState.state == "OPEN" ) {
        garageCurrentState.sendCommand("OPEN")
     } else {
         garageCurrentState.sendCommand("CLOSED")
     }
end

in my case i had to make 3 virtual items, for currentState, targetState and obstruction. the last one has no mapping and no rules

regarding other questions:

  • you can have more than one tag assign but both characteristics should expect the same values. in case of garage door: currentState support values “OPEN, OPENING, CLOSED, CLOSING, STOPPED”, targetState only " ON/“OPEN” = open door, OFF/“CLOSED” = closed door".

  • you can find more information on the add on documentation page
    HomeKit Add-on - System Integrations | openHAB
    but for sure, it can be improved, e.g. garage door examples is missing there

Hello,

thanks… now I got it. Now I understand what is meant with Example Block.

I solved my issue without a rule. I extend my MQTT python garageDoor program (based on meross-bridge from Daniel Morlock) to provide following MQTT topics:
current_door_state: messages [OPEN, OPENING, CLOSED, CLOSING]
target_door_state: messages [OPEN, CLOSED]

That is the thing in $OPENHAB_CONF/things/garageOpener.things :

Bridge mqtt:broker:broker "MQTT Broker" [ host="localhost", port=1883, secure=false, clientID="meross-bridge-client" ] {
    Thing topic garage_opener_device_garage_am_haus "Meross Garage Opener: Garage am Haus" {
        Channels:
            Type string : name               "name"               [stateTopic="meross/1911087511756090804648e1e91117ac/name"]
            Type string : currentDoorState   "currentDoorState"   [stateTopic="meross/1911087511756090804648e1e91117ac/current_door_state"]
            Type switch : targetDoorState    "targetDoorState"    [stateTopic="meross/1911087511756090804648e1e91117ac/target_door_state", on="OPEN", off="CLOSED", commandTopic="meross/1911087511756090804648e1e91117ac/set/target_door_state"]
    }
}

That are the items in $OPENHAB_CONF/items/garageOpener.items :

Group   garage_opener_device_garage_am_haus                   "Garage am Haus"                   <garagedoor>                                           {homekit="GarageDoorOpener"}
String  garage_opener_device_garage_am_haus_name              "Garage am Haus:Name"              <none>          (garage_opener_device_garage_am_haus)  {homekit="Name",             channel="mqtt:topic:broker:garage_opener_device_garage_am_haus:name"}
String  garage_opener_device_garage_am_haus_currentDoorState  "Garage am Haus:CurrentDoorState"  <none>          (garage_opener_device_garage_am_haus)  {homekit="CurrentDoorState", channel="mqtt:topic:broker:garage_opener_device_garage_am_haus:currentDoorState"}
Switch  garage_opener_device_garage_am_haus_targetDoorState   "Garage am Haus:TargetDoorState"   <none>          (garage_opener_device_garage_am_haus)  {homekit="TargetDoorState",  channel="mqtt:topic:broker:garage_opener_device_garage_am_haus:targetDoorState"}
Switch  garage_opener_device_garage_am_haus_obstruction       "Garage am Haus:ObstructionState"  <none>          (garage_opener_device_garage_am_haus)  {homekit="ObstructionStatus"}

Thank you for the posts that lead me to the solution!!!

Regards

1 Like

Hi Florian,
I am trying to integrate my Meross Garage Opener in the same way you did.
But I am still struggling with the Python script to get the right MQTT topics to see the current status of the garage door.
You can share your python script?

Michael