Closed mercballs closed 5 years ago
Why? They don't have temperature measurement. I used them with Xiaomi official app, and they just report battery and opening state.
They do have a temperature sensor. The temperature is reported in deconz and in the rest API.
I have seen the temperature reading in deconz as well. But as far as I know the door sensor had no temperature sensor in it. Be sides the reading makes no sense, as I doubt it was 30+ celcius in the room the sensor when the room next to it was only 22 degrees.
Yeah, very useful. I see, just one of my three sensors actually reports a temperature.
That was:
So, even if some device reports temp, that stay as totally pointless.
I believe they only report temperature when the door/window status changes. For sensors that are used most often, I find the readings pretty good. For sensors that have not been operatred in a while I would agree that the temperatures are off.
I have written a node-red flow to pull these temps from the rest-api and publish them to mqtt so I can view them in home assistant. If anyone is curious, here it is:
[{"id":"7f0b743d.047d1c","type":"inject","z":"750675f2.f9148c","name":"","topic":"","payload":"","payloadType":"date","repeat":"60","crontab":"","once":false,"onceDelay":0.1,"x":370,"y":220,"wires":[["4cfe459a.ab9d6c"]]},{"id":"4cfe459a.ab9d6c","type":"http request","z":"750675f2.f9148c","name":"","method":"GET","ret":"obj","url":"http://192.168.10.201/api/AA8F97682F/","tls":"","x":530,"y":220,"wires":[["8ff6f380.752d5"]]},{"id":"9d66fe59.38e64","type":"mqtt out","z":"750675f2.f9148c","name":"","topic":"","qos":"0","retain":"true","broker":"3e01161.062e5ea","x":870,"y":220,"wires":[]},{"id":"8ff6f380.752d5","type":"function","z":"750675f2.f9148c","name":"CRAZY","func":"var obj = msg.payload.sensors;\nvar keys = Object.keys(obj);\nvar names = [];\nvar temps = [];\n\nfor(var i=0; i<keys.length;i++) { \n if ('config' in obj[keys[i]] && 'temperature' in obj[keys[i]].config) {\n \n names.push(obj[keys[i]].name);\n temps.push(obj[keys[i]].config.temperature);\n \n //node.warn(obj[keys[i]].config.temperature.toString());\n }\n}\nmsg = {};\nfor(var i=0; i<names.length;i++) { \n msg.payload = Math.round(temps[i] / 100 * 1.8 + 32);\n \n msg.topic = \"temps/\" + names[i];\n node.send(msg);\n}\n","outputs":1,"noerr":0,"x":700,"y":220,"wires":[["9d66fe59.38e64"]]},{"id":"3e01161.062e5ea","type":"mqtt-broker","z":"","broker":"192.168.10.14","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"15","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""}]
@manup any thoughts on this?
Since the temperature reported by non temperature sensors of Xiaomi is very coarse, there are currently no plans to put the little extra info in a rest api sensor resource.
The coarse temperature value might not be used as reliable temperature but I don't think it's useless, for example it might be used for automations which use night/daytime differences of the reported value.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I've been testing one of these recently as well. deconz reports the temp, but homeassistant does not. If it has temperature capabilities, it should expose this, otherwise if not, it shouldn't.
Confusing because the wiki claims the temperature capability is supported; although it is not fully supported.
@JSkier21 there is no support yet for the secondary temperature sensor certain Xiaomi devices report. I'm refactoring the deconz library and that will help in the possibility of supporting the secondary sensors later on, since due to the old design there could really only be one origin of the temperature sensor. It has been stated on multiple occassions that those temperatures are unreliable so I have also previously decided against supporting them.
those temperatures are unreliable so I have also previously decided against supporting them.
Indeed. I don't support them in homebridge-hue either.
Thanks for the feedback @Kane610 and @ebaauw. The nature of it makes sense; my Lightify motion sensors work great, but different brand + setup.
@JSkier21 you're saying that you have Osram devices reporting temperatures in config? Are they reliable?
my Lightify motion sensors work great
PIR motion sensors are thermometers; they detect motion by changes in the IR spectrum.
Osram devices reporting temperatures in config
Afaik, config.temperature
is used only for the onboard temperature reported by Xioami devices in their special attribute report. I suspect the OSRAM lightify motion sensor exposes a Temperature Measurement cluster (like the Hue motion sensor), which the REST API exposes as a separate ZHATemperature sensor.
If that is the case it should work for home assistant
@ebaauw is correct, ZHATempature has the value on the Lightify motion sensor. Readings are very similar (within one degree) to a dht22 sensor I have nearby, which is accurate.
Thus, value is visible in API and also passed on to homeassistant.
Would it be possible to expose the temperature from the Aqara door/window sensors as separate sensors? I believe it would make it easier to use this data if all temperature sensors were exposed in a standardized way.