Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homekit doesn't read status correctly #11

Open
HairBear22 opened this issue Dec 31, 2016 · 6 comments
Open

Homekit doesn't read status correctly #11

HairBear22 opened this issue Dec 31, 2016 · 6 comments

Comments

@HairBear22
Copy link

HairBear22 commented Dec 31, 2016

I have a MQTT switch set up, with the config attached below. When I use the correct get topic, Homekit won't retain the switch being on (when I flip it to on on my phone, it publishes the right topic, but the switch on homekit instantly returns to "off", while the device is "on".


"accessory": "mqttswitch",
		"name": "Sonoff A1",
		"url": "mqtt://127.0.0.1",
		"username": "",
		"password": "",
		"caption": "Christmas Lights",
				"topics": {
			"statusGet": "stat/sonoffA1/POWER",
			"statusSet": "cmnd/sonoffA1/power"
		},
		"onValue": "ON",
		"offValue": "OFF",
		"integerValue": "false"
@osvaldoasn
Copy link

Use topics like this:
"topics": {"statusGet":"cmnd/sonoff/light","statusSet":"cmnd/sonoff/light"}

@bleachhun
Copy link

Hi, homekit default off reconnect wifi. Not read status HomeBridge?

@gid204
Copy link

gid204 commented Jan 11, 2017

@HairBear22 I'm having the exact same problem.

Have put it all on one line as @osvaldoasn suggested but it didn't fix the issue...

@TLCary
Copy link

TLCary commented Jan 11, 2017

Working around by reading the echo of the command instead of reading the status wont update when another HomeKit clients changes the switch. Sonoff-MQTT returns a capital ON or OFF.
Line 85 that.switchStatus = (status == "ON") ? true : false;
Is a quick fix. I'll work on weaving it in and adding one more configuration to implementing it properly and then do a pull request.

@HairBear22
Copy link
Author

Awesome! Any ETA on that? @TLCary

@Kisaua
Copy link

Kisaua commented Jan 24, 2017

Great. For me works fine with "ON" in line 85.
btw, "ON" "OFF" onValue and offValue gives default true and false.
if you set onValue = "off" it will work with default true value. should use "true" and "false" values i config.
the same is in case with the "integerValue": "true"
onValue = 0 will work in the code like "true"

and MQTT responce are case sensetive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants