-
Notifications
You must be signed in to change notification settings - Fork 71
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
Accessory state is not checked upon start #50
Comments
The payload format can be either an object with |
No, not quite. I've been reading through the code, and I now realise that I'm going to capture a couple of log sequences and get back to you on this. |
OK, so here's a log of what # initial telemetry setting
cmnd/socket3/TelePeriod:'60'
# outlet reply
stat/socket3/RESULT:'{"TelePeriod":"60"}'
# switch off command
cmnd/socket3/POWER:'OFF'
# outlet reply
stat/socket3/RESULT:'{"POWER":"OFF"}'
# outlet status report (happens after the reply)
stat/socket3/POWER:'OFF'
# switch on command
cmnd/socket3/POWER:'ON'
# outlet reply
stat/socket3/RESULT:'{"POWER":"ON"}'
# outlet status report (happens after the reply)
stat/socket3/POWER:'ON'
# manual off
stat/socket3/RESULT:'{"POWER":"OFF"}'
stat/socket3/POWER:'OFF'
# recurring telemetry
tele/socket3/STATE:b'{"Time":"2017-12-25T23:56:50","Uptime":120,"Vcc":3.122,"POWER":"OFF","Wifi":{"AP":1,"SSId":"IoT","RSSI":48,"APMac":"DC:A4:CA:XX:XX:XX"}}' Based on the above, I'm tempted to assume that this is the config I need: "topic": {
"statusOn": "stat/socket3/POWER",
"setOn": "cmnd/socket3/POWER"
},
"payload": {
"onTrue": "ON",
"onFalse": "OFF"
}, ...but on a first attempt nothing happens when I switch the outlet on manually, and reading through the code I don't see any obvious status checks... Any ideas? |
are the messages on `stat/socket3/POWER´ published retained? |
No.
… On 5 Jan 2018, at 21:19, Sebastian Raff ***@***.***> wrote:
are the messages on `stat/socket3/POWER´ published retained?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I guess then that's the issue. Homekit2mqtt relies on getting retained status messages. To be sure you could just test if it behaves ok when you publish the status again after start of homekit2mqtt. |
Question is now: do have the possibility to retain these messages? Otherwise - implementing a get-topic config var to all characteristics wouldn't be that much effort, could do it, but can't promise when. |
Not without changing the firmware running on these devices. Relying on the messages being retained seems like an odd requirement, really.
|
hmm I don‘t think thats odd, thats what retained messages are made for - giving clients the possibility to get the last known status without having to send a message to request a status update. I think it‘s odd not to retain these messages :-) |
If I'm understanding correctly you are using Sonoff devices running the Sonoff-Tasmota firmware. Is that right? If so it seems that they can be configured to set retain on messages. It is mentioned in the commands section of the wiki for the repo. Search the page for "PowerRetain." I don't have any of these devices yet so I can't test it on my end but that may fix your problem. |
Will close the issue for now, feel free to reopen if you want to discuss this further. |
Hello ! I have the same problem. After starting homekit2mqtt all switches is ON and no sensor information. |
You need to make sure that your devices are setting the retain flag when they send their messages to your MQTT broker. If you devices aren't setting this flag the MQTT broker just passes the message along and then forgets it. HomeKit2MQTT itself does not store the state of MQTT devices and relies on the MQTT broker to give it the last known state when it starts up. Hope that helps. |
I'm trying to replace a
homebridge
setup that useshomebridge-mqtt-tasmota
, and even though I can toggle outlet power, the HomeKit devices do not mirror the actual device states no matter what I do.I initially suspected this was due to the requirement for the
{"val": ...
payload format (which I cannot customise without re-flashing all the devices), but I may be mis-understanding the topic structure.The solution I'm using is very clear on the topic meaning, and looks like this:
I tried using the
statusGet
topic as input tostatusOn
, but the semantics seem to be different, and the outlet code does not seem to issue a status request, only listen passively for a message in the right topic.Any hint as to how to configure
homekit2mqtt
for this kind of setup?The text was updated successfully, but these errors were encountered: