Closed dgtal1 closed 5 years ago
Is it really "Unavailable" ? Or just "unknown". If it's unavailable that means that HA can't connect to the ESP. For that please look in the HA logs (and paste them here).
Also try removing the ESP from the integrations screen and re-adding it.
Yes, all sensors related to this MiFlora device are shown as 'Unavailable' in HA. The ESP surly does connect to HA as it sends readings of the ADC inputs and the MiJia device. I also added my 2nd MiFlora and its readings are sent to HA. No problem here. It's just this one MiFlora that is not being pushed to HA. The initial warnings in logs are probably related to HA restart I made to get rid of the old entities coming from MQTT. Before I switched from MQTT to the API I observed the MQTT debug messages from the ESP and I observed no status updates from this device despite the fact that the ESP does receive the messages from MiFlora. I can see that in the logs (attched in the original post). So all I can think of is not a problem in HA <-> ESP communication, but with the ESP software.
Update: I removed all sensors from the config leaving only the failing MiFlora and got it working again. Also noticed in the integrations screen that the entity name was changed. Now I'm not sure any longer if this is esphome or HA bug. Perhaps something screwed up in the entity registry in HA. But this does not explain no messages observed in the MQTT client. I'm sure I didn't make any OTA yesterday nor changed something in HA. Sort of a "X-Files" case ;) Well, let me observe it for a couple of days perhaps and if it'll be running find - I'll close this issue. Thanks for the immediate reply.
I'm facing the same situation, it keep running for about 24h, then it stops updating Mifloras. I placed a restart switch on ESP32 yaml, and remotely restart it... it then starts updating again...
Yesterday I was about to close this issue, but it happened to me again. Something's wrong with Esphome. This time the entities did not appear as 'Unavailable', so HA was ok. It must have been something wrong with esphome. The weird thing is that I setup automatic restart every 24 hours, which happens at noon (12:00) and the time when the tracker stopped working was 2 hours later. Only 2 hours after the automatic restart. The rest of the entities (ADC inputs) were tracked fine all the time, no interruptions, so ESP32 as a whole was working fine. Only BLE devices were not updated - neither Mi Flora, nor MiJia temp sensor. So there is something wrong with the BLE tracker. Restarting the ESP32 programatically ( a switch wuth latform: restart) solved it.
Thats exactly what I'm facing. I also setup a restart at 00:00 to minimize this issue.
In that case I'm marking this as a duplicate of https://github.com/esphome/issues/issues/317 and merging the discussions there. - unavailable
would mean HA cannot connect to the ESP, unknown
is the thing described in #317
Operating environment/Installation (Hass.io/Docker/pip/etc.):
HA in Docker. Esphome installed in Windows 10 with pip
ESP (ESP32/ESP8266, Board/Sonoff):
ESP32 WROOM DEVKIT V1 https://www.aliexpress.com/item/32849567377.html?spm=a2g0s.9042311.0.0.579e4c4dpgaE7U
Affected component:
https://esphome.io/components/sensor/xiaomi_miflora.html?highlight=miflora
Description of problem: Yesterday suddenly the ESP32 BLE tracker stopped tracking my MiFlora device. Home Assitant shows its sensors as 'Unavailable' and the history graph shows just a horizontal line as no new values are pushed by the tracker. The MiFlora device is fully functional as I'm able to connect to it with my smartphone and see current readings. The ESP32 board is also fine I guess - it tracks MiJia temperature and humidity without any problems. The BLE signal range is not a problem either. I put it next to the ESP board and still no luck getting it work again. I restarted the ESP32 - didn't help. I did a new OTA upgrade - didn't help either. I added this workaround with the restart switch - didn't help. Restarting doesn't help in general. Today I switched from MQTT to the native API - didn't help.
In the logs I see that the tracker receives the mesages from MiFlora, but does not push it to HA either via MQTT or the API.
If this matters - my ESP32 board is a tracker for 1 MiFlora device and 1 MiJia device + reads 3 ADC inputs. I wanted to add more MiFlora devices but now I'm in doubts if this makes sense as the 1st one stopped working suddenly and noting helps.
Problem-relevant YAML-configuration entries:
Traceback (if applicable):
Additional information and things you've tried: