Skip to content

Unsupported firmware ? #25

@geensr

Description

@geensr

I am using this module on a raspberry PI running the standard home-assistent setup. Currrent versions are core-2021.11.5, supervisor-2021.10.8 and Home Assistant OS 6.6.

The hardware is recently bought from https://www.aliexpress.com/item/1005003430486580.html and works fine in the MI app on Android.

From the Debug logs I get following result (not clear why there is only one read action in the log, according to the code the line where the battery info is read should also be logged).

2021-12-08 16:19:08 DEBUG (SyncWorker_6) [mitemp_bt.mitemp_bt_poller] Filling cache with new sensor data.
2021-12-08 16:19:11 DEBUG (SyncWorker_6) [mitemp_bt.mitemp_bt_poller] Received result for handle 36: b'Time\x00'
2021-12-08 16:19:12 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.bathroom_upstairs_temperature fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 468, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 658, in async_device_update
raise exc
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/mitemp_bt/sensor.py", line 147, in update
data = self.poller.parameter_value(self.entity_description.key)
File "/usr/local/lib/python3.9/site-packages/mitemp_bt/mitemp_bt_poller.py", line 126, in parameter_value
self.fill_cache()
File "/usr/local/lib/python3.9/site-packages/mitemp_bt/mitemp_bt_poller.py", line 59, in fill_cache
self.firmware_version()
File "/usr/local/lib/python3.9/site-packages/mitemp_bt/mitemp_bt_poller.py", line 106, in firmware_version
self.battery = int(ord(res_battery))
TypeError: ord() expected a character, but string of length 15 found
2021-12-08 16:19:12 DEBUG (SyncWorker_5) [homeassistant.components.mitemp_bt.sensor] Polling data for Bathroom upstairs Humidity
2021-12-08 16:19:12 DEBUG (SyncWorker_5) [mitemp_bt.mitemp_bt_poller] Filling cache with new sensor data.
2021-12-08 16:19:12 WARNING (SyncWorker_5) [homeassistant.components.mitemp_bt.sensor] Polling error Could not read data from Mi Temp sensor A4:C1:38:8D:C1:57
2021-12-08 16:19:38 DEBUG (SyncWorker_3) [homeassistant.components.mitemp_bt.sensor] Polling data for Bathroom upstairs Temperature
2021-12-08 16:19:38 DEBUG (SyncWorker_3) [mitemp_bt.mitemp_bt_poller] Using cache (0:00:26.449007 < 0:05:00)
2021-12-08 16:19:38 WARNING (SyncWorker_3) [homeassistant.components.mitemp_bt.sensor] Polling error Could not read data from Mi Temp sensor A4:C1:38:8D:C1:57

and so on.

The error is not repeated in the log but no data is ever received, also not when the cache timeout expires.

If there is anything I can do to help debug this please let me know.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions