There is an event for the creation and then it sends the temperature but only once (when created)
After that, there is no mention of the sensor anymore in the logs.
12:07:58.715 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - ‘mihome:sensor_weather_v1:158d0002272e1b’ changed from INITIALIZING to ONLINE
12:08:34.003 [INFO ] [thome.event.ItemChannelLinkAddedEvent] - Link ‘LivingRoom_TemperatureHumiditySensorTemperature_Decimal-mihome:sensor_weather_v1:158d0002272e1b:temperature’ has been added.
12:08:34.023 [INFO ] [smarthome.event.ItemStateChangedEvent] - LivingRoom_TemperatureHumiditySensorTemperature_Decimal changed from 17.559999465942383 to 19.969999313354492
I have the same hardware and they send updates regularly (not in distinct intervals but at least every 15mins or so) and they send them also with small increments… you don’t get any other entries in the logs? check openhab.logs also?
Have you checked if the non-GUI updates do work in the background?
Maybe create a rule on a temperature change that logs something.
If this doesn’t show anything, then set loglevel for the Xiaomi to debug and check if heartbeats come in (the binding should receive a datagram from each gateway every ten seconds, and on each update).
Thanks.
I have checked the logs. There is nothing regarding temperature or humidity change in neither openhab.logs nor events.logs.
I am not familiar with rules and config files. I will check how to set loglevel and create a rule to print log when value change and see if I have more infos.
Login to the Karaf console and set the loglevel to DEBUG:
SSH to your Pi
ssh openhab@localhost -p 8101 (pass: habopen)
type in the Karaf console log:set DEBUG org.openhab.binding.mihome
then you should have the “heartbeat” of the Gateway in the logs - perhaps there’s more infos.
after that you can log:set INFO org.openhab.binding.mihome again.
To have a clean installation, I have removed one of my sensor from OH and from the MiHome app and re-added it.
I have also set the loglevel to DEBUG
Here is what I have :
21:31:23.320 [DEBUG] [ng.mihome.handler.XiaomiBridgeHandler] - Device 158d0002272e1b honored read request
21:31:23.325 [DEBUG] [.discovery.XiaomiItemDiscoveryService] - Detected Xiaomi smart device - sid: 158d0002272e1b model: weather.v1
21:31:23.353 [INFO ] [ig.discovery.internal.PersistentInbox] - Added new thing ‘mihome:sensor_weather_v1:158d0002272e1b’ to inbox.
21:31:23.356 [INFO ] [smarthome.event.InboxAddedEvent ] - Discovery Result with UID ‘mihome:sensor_weather_v1:158d0002272e1b’ has been added.
21:31:46.694 [INFO ] [smarthome.event.InboxRemovedEvent ] - Discovery Result with UID ‘mihome:sensor_weather_v1:158d0002272e1b’ has been removed.
21:31:46.731 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - ‘mihome:sensor_weather_v1:158d0002272e1b’ changed from UNINITIALIZED to INITIALIZING
21:31:46.733 [DEBUG] [ng.mihome.handler.XiaomiBridgeHandler] - Adding item listener for device 158d0002272e1b
21:31:46.733 [DEBUG] [ng.mihome.handler.XiaomiBridgeHandler] - Having 2 Item listeners
21:31:46.746 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - ‘mihome:sensor_weather_v1:158d0002272e1b’ changed from INITIALIZING to ONLINE
21:31:46.750 [DEBUG] [ihome.handler.XiaomiDeviceBaseHandler] - Device 158d0002272e1b on channel mihome:sensor_weather_v1:158d0002272e1b:humidity received command REFRESH
21:31:46.750 [DEBUG] [ihome.handler.XiaomiDeviceBaseHandler] - Device 158d0002272e1b on channel mihome:sensor_weather_v1:158d0002272e1b:temperature received command REFRESH
21:31:46.772 [DEBUG] [ihome.handler.XiaomiDeviceBaseHandler] - Update Item 158d0002272e1b with retented message
21:31:46.774 [DEBUG] [ihome.handler.XiaomiDeviceBaseHandler] - Item got update: {“cmd”:“read_ack”,“model”:“weather.v1”,“sid”:“158d0002272e1b”,“short_id”:6929,“data”:“{"voltage":2905,"temperature":"2180","humidity":"10000","pressure":"101440"}”}
21:32:49.685 [DEBUG] [ihome.handler.XiaomiDeviceBaseHandler] - Device 158d0002272e1b on channel mihome:sensor_weather_v1:158d0002272e1b:temperature received command REFRESH
21:32:49.689 [INFO ] [thome.event.ItemChannelLinkAddedEvent] - Link ‘LivingRoom_Sensor_Temperature-mihome:sensor_weather_v1:158d0002272e1b:temperature’ has been added.
21:33:07.112 [DEBUG] [ihome.handler.XiaomiDeviceBaseHandler] - Device 158d0002272e1b on channel mihome:sensor_weather_v1:158d0002272e1b:humidity received command REFRESH
21:33:07.112 [INFO ] [thome.event.ItemChannelLinkAddedEvent] - Link ‘LivingRoom_Sensor_Humidity-mihome:sensor_weather_v1:158d0002272e1b:humidity’ has been added.
This was a little bit more than 30 minutes ago. I have hold and released the sensor from my hand to see if temperature change would trigger something but since these logs, there is no mention of the Sensor.
@shabbab I have created 2 rules : 1 for my light and 1 for the sensor. (they are identical, the light one was to see if I wrote the rule correctly). The light one keeps triggering infos but the sensor one does not.
Here is the rule I have created
rule "Temp"
when
Item LivingRoom_Sensor_Temperature received update
then
logInfo("temp.rules", "LivingRoom: Temperature: " + LivingRoom_Sensor_Temperature.state)
end
I see you have successfully set the Xiaomi loglevel to debug, but there are no heartbeats in the logfile.
You should see one debug log sentence every ten seconds.
If there really is no constant flow of messages every ten seconds (or more often) this means you are not receiving the multicast data.
Look at my post a few days back, depending on your network topology you may have similar issues.
A fix (for my situation) is in the followup post
BTW: The routing table fix is active for a day now, seems to work reliably.
testing is best done in a RPi! especially, if you like to run oh2 on that platform
I suggest, you start with openHABian - you can always paste your existing files to the new installation.
What startles me, that there are no more heartbeats reaching OH2 - but my guess is, your MAC firewall filters those.
i am trying to showing up my xiaomi windows sensor in my apple homekit but i am unable to find tags for this
xiaomi string:
Contact WindowSwitch_Status { channel=“mihome:sensor_magnet::isOpen” }
but i do no know or [“door”] or what ever is working
also i am unable to get working xiaomi gateway lamp
i have it in my homekit app but i am unable to turn it in or off
but when i turn it on from xiaomi app they show up like turned on in homekit app
it seems that xiaomi lamp is unable to manage from homekit
do you have any experiences with xiaomi integration ?
@binderth
thanks i saw this document and that’s mean i am not able to add contact sensor via openhab to homekit ?
@Olymp
i had this string and xiaomi ID
but i am unable to integrated it via homekit bindings
do you have your xiaomi devices working with homekit ?
my xiaomi temerature is fine with this
Number HT_Temperature_studio “Studio temperature” [ “CurrentTemperature” ] { channel=“mihome:sensor_ht:158d0001f4ec83:temperature” }
i never tried Contact, but my guess is, it won’t work: ['Switchable'] will return ON/OFF and not OPEN/CLOSED… you could still try. but there’s definitely no ['Door'] in homekit.
you could either change your item to Switch instead of Contact or you could expose a proxy item as Switch to the homekit and have a rule Change your Contact item accordingly.