Closed njh closed 3 years ago
I have no idea why I was struggling with this but I have it working fine now.
I found that positionState
did very little in the Apple Home app, so I have removed it from my configuration.
Here is my config:
"living-room-blinds": {
"name": "Living Room Velux Window",
"manufacturer": "Velux",
"category": 14,
"services": [
{
"name": "Velux Blinds",
"service": "WindowCovering",
"topic": {
"setTargetPosition": "living-room/velux/blinds/command",
"statusTargetPosition": "living-room/velux/blinds/target_position",
"statusCurrentPosition": "living-room/velux/blinds/current_position"
},
"payload": {},
"config": {},
"props": {}
}
]
}
I listen to the command
topic for instructions what to do and then update target_position
and current_position
.
current_position
= target_positon
= 100, then the tile displays 'Open'current_position
= target_positon
= 0, then the tile displays 'Closed'current_position
= target_positon
= 55, then the tile displays '55% Open'current_position
is less than target_positon
, then the tile displays 'Opening...' with a spinnercurrent_position
is greater than target_positon
, then the tile displays 'Closing...' with a spinnerI hope if someone finds this, having the same problem, it helps them in some way.
Reopening as I haven't got it working completely after all. It is working fine on Home.app (Version 4.0 (367.7)) on my Mac but not on my iPhone (iOS 14.2).
I have done some testing with the HomeKit simulator and that is working fine. So I think there must be a bug somewhere....
I did some more testing and got a Window Covering behaving correctly using homebridge-mqttthing instead:
{
"accessory": "mqttthing",
"type": "windowCovering",
"name": "Living Room Blinds",
"topics": {
"getCurrentPosition": "living-room/blinds/current-position",
"getPositionState": "living-room/blinds/state",
"getTargetPosition": "living-room/blinds/target-position",
"setTargetPosition": "living-room/blinds/command"
},
"positionStateValues": [
"closing",
"opening",
"stopped"
]
}
There were some Homebridge plugins I wanted to try using anyway, so decided to make the switch away from homekit2mqtt.
Thanks for homekit2mqtt, I happily used it for a long time!
I have been using homekit2mqtt for a little while now, to control my lights, central heating and display temperatures using HomeKit - thanks @hobbyquaker! I have recently managed to control my Velux RSL Roller Binds by circuit-modding a remote control to fake button presses using an Arduino. And hooked it up to MQTT using Node-RED.
However I am having trouble with getting a WindowCovering service working. I am seeing messages pubished to the
setTargetPosition
topic Ok. But then the Home app gets stuck saying 'Opening...' or 'Closing...' and doesn't seem to respond to messages published tostatusCurrentPosition
orstatusPositionState
.Here is a screen recording on my Mac after pressing the tile:![blinds-opening](https://user-images.githubusercontent.com/38734/100528576-7cb60c80-31d6-11eb-92b7-3f68ae434880.gif)
As far as I can tell the debug messages look like they are working correctly.
I have
targetPositionFactor
andcurrentPositionFactor
using the default values of 1. So blinds open =100
and blinds closed =0
.I am using the following to simulate my blinds:
Here is the contents of the homekit2mqtt logs - which all seems fine to me:
And here is my configuration section:
Has anyone got a WindowCovering service working? Any idea what I am doing wrong? The CurrentPosition doesn't seem to be displayed in the Home.app? Is it used? Should the PositionState be used to update the current state of the tile in the app?
Thanks!
nick.