Comments (13)
The payload format can be either an object with val
attribute or just a plain value, works both - so this should not be the problem.
The Message published on the topic you configured for statusOn
should be retained, is that the case? Can you please provide the config snippet of the outlet accessory as well as the debug log showing switch on/off?
from homekit2mqtt.
The Message published on the topic you configured for statusOn should be retained, is that the case?
No, not quite. I've been reading through the code, and I now realise that homekit2mqtt
works quite differently from the homebridge
plugin (which in turn sends out messages in tele/devicename/STATE
to force the the accessories report their state when it starts). Also, my Sonoff outlets send out notifications when they're manually powered on, so the topic semantics are different.
I'm going to capture a couple of log sequences and get back to you on this.
from homekit2mqtt.
OK, so here's a log of what homebridge
sends out to the outlets:
# 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?
from homekit2mqtt.
are the messages on `stat/socket3/POWER´ published retained?
from homekit2mqtt.
from homekit2mqtt.
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.
from 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.
from homekit2mqtt.
from homekit2mqtt.
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 :-)
Think of a User Interface e.g that shows hundred or more devices - do you really think it‘s better to send out 100 status request messages or just to subscribe and receive them retained?
from homekit2mqtt.
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.
from homekit2mqtt.
Will close the issue for now, feel free to reopen if you want to discuss this further.
from homekit2mqtt.
Hello ! I have the same problem. After starting homekit2mqtt all switches is ON and no sensor information.
from homekit2mqtt.
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.
from homekit2mqtt.
Related Issues (20)
- Adding custom prefix/customize published MQTT payload for clients with multiple services
- Project status HOT 2
- ToObject deprecation warnings on install
- stuck on: mqtt homekit/connected 0 0 HOT 2
- Error: libnode.so.64: cannot open shared object file: No such file or directory HOT 1
- Is it possible to use on an external network? HOT 1
- Looking for the complete docker installation command, failed to start all the time! HOT 1
- How to Set Setup ID HOT 1
- Installation failure HOT 1
- Home Assistant to MQTT bridge HOT 2
- homekit2mqtt Installation HOT 2
- Error while trying to install HOT 4
- Send homekit device to MQTT
- Device status isn't updated
- Velux Bind: Anyone got WindowCovering service working? HOT 3
- Temperature sensor DHT11 on Tasmota device
- Misleading project name (should be mqtt2homekit) HOT 2
- 安装不上 能不能打包一个docker镜像使用docker运行
- 安装不上 能不能打包一个docker镜像使用docker运行
- 安装不上 能不能打包一个docker镜像使用docker运行
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from homekit2mqtt.