Auto integrate all Xiaomi devices to HomeAssistant via miot-spec

Xiaomi Miot For HomeAssistant

English | 简体中文

MIoT-Spec: The protocol specification for Xiaomi IoT devices, is a standard designed by the Xiaomi IoT platform to describe the function definition of hardware products according to the networking mode of hardware products, the characteristics of product functions, the characteristics of user usage scenarios and the user’s requirements for hardware product use experience specification.

This component uses the miot protocol to automatically integrate Xiaomi devices into HomeAssistant, and currently supports most Xiaomi IoT devices. And it supports HA Web UI, and you can easily integrate Xiaomi devices into HA without configuring yaml.

Installing

Download and copy custom_components/xiaomi_miot folder to custom_components folder in your HomeAssistant config folder

# Auto install via terminal shell
wget -q -O - https://cdn.jsdelivr.net/gh/al-one/hass-xiaomi-miot/install.sh | bash -

Or you can install component with HACS

Config

:gear: Configuration > :jigsaw: Integrations > :heavy_plus_sign: Add Integration > :mag: Search Xiaomi Miot Auto

Or click: Add Integration

Add devices using Mi Account:

Starting from the v0.4.4 version, the component has added support for selecting the connection device mode when integrated by account:

  • Automatic: The component will regularly update the devices that support miot-spec in LAN, and automatically use the local connection for the supported devices (recommended)
  • Local: All devices filtered by the integrated configuration will use local connection. If you check the devices that do not support miot in LAN, they will be unavailable
  • Cloud: All devices filtered by the integrated configuration will use cloud connection. It is recommended that miio, BLE, ZigBee devices use this mode

Add device using host/token:

Suitable for devices support miot-spec protocol in LAN

Config Xiaomi Cloud:

Config Xiaomi cloud for the devices integrated by host/token

# configuration.yaml
xiaomi_miot:
  username: xiaomi_username
  password: xiaomi_password
  # server_country: cn # location of xiaomi cloud: cn(default), de, i2, ru, sg, us

:gear: Configuration > :jigsaw: Integrations > Xiaomi Miot Auto > Options > :ballot_box_with_check: Enable miot cloud

Config translation languages:

# configuration.yaml
xiaomi_miot:
  language: zh # Using the built-in dictionary, currently only `zh` is supported
  # https://github.com/al-one/hass-xiaomi-miot/blob/master/custom_components/xiaomi_miot/core/translation_languages.py
  translations:
    # Global dictionary
    idle: '空闲'
    busy: '工作中'
    # Dictionary for specifying fan modes
    fan.mode:
      'straight wind': '直吹模式'
      'natural wind': '自然风'
    # Dictionary for specifying the drying modes of the washer
    washer.drying_level:
      moist: '微湿'
      extra: '特干'

Customize entity

# configuration.yaml
homeassistant:
  customize: !include customize.yaml

# Customize via device model
xiaomi_miot:
  # https://github.com/al-one/hass-xiaomi-miot/blob/master/custom_components/xiaomi_miot/core/device_customizes.py
  device_customizes:
    'chuangmi.plug.212a01':
      miot_local: true
      chunk_properties: 7


# Customize via parent entity
# customize.yaml
domain.your_entity_id:
  miot_local: true        # Force to read and write data in LAN (integrate by account)
  miot_cloud: true        # Enable miot cloud for entity (read, write, action)
  miot_cloud_write: true  # Enable miot cloud (only write)
  miot_cloud_action: true # Enable miot cloud (only action)
  check_lan: true         # Check LAN connection in cloud mode
  miio_properties: power,battery # Get miio properties to state attributes
  miio_cloud_props: prop.power,event.dev_online

# Custom sub entities
domain.parent_entity_id:
  sensor_properties: temperature,humidity,illumination # Miot properties
  binary_sensor_properties: is_volume_muted,any_boolen_property
  switch_properties: on,power
  number_properties: volume
  fan_properties: mode,fan_level
  cover_properties: motor_control

climate.your_entity_id:
  bind_sensor: sensor.temperature_entity,sensor.humidity_entity # Sensor entities

camera.your_entity_id:
  video_attribute: 1   # https://github.com/al-one/hass-xiaomi-miot/issues/11#issuecomment-773054167
  keep_streaming: true # Continuously update stream address

cover.your_entity_id:
  closed_position: 5   # Change cover state to closed when position <= 5%
  deviated_position: 2 # Current position deviation 2% -> 0%, 98% -> 100%
  motor_reverse: true  # Reverse motor state
  open_texts: Open,Up
  close_texts: Close,Down

doamin.your_entity_id:
  interval_seconds: 30 # Seconds between each update state (Requires reload config entry)
  chunk_properties: 10 # Chunk miot properties on update state (LAN)

Recommended Customization Using The UI:

:gear: Configuration > :paintbrush: Customize > :mag: Select Entity > Add Other Attribute

Great add-on, I use it via Mi cloud but have a problem. Magnetic door contacts constantly shows “closed”, though doors are open. Temperature sensors are working fine.

how do you execute actions?

In fact, this component is not very suitable for magnetic door contacts, especially for motion sensors, because it obtains device status through polling.
But you can customize the entity attributes for the magnetic door contact entity:

# customize.yaml
binary_sensor.your_entity_id:
  interval_seconds: 5 # Seconds between each update state
1 Like

Hi
I just started using the integration for Xiaomi miflora. I really like that I can use the ceiling lamps as a gateway, a functionallity that I wanted for a very long time. I using the cloud connection to them.
I’m not getting updates after the initial installation. I don’t know if this functionallity limited like the magnetic door contacts?

Thanks for a very nice Integration!
Brian

Show me the state attributes of the entity and related logs if any.

Thanks for getting back to me so fast:

Here are details from the developer tools:

and from one of the devices:
image
It seems that is loosing contact after some time.

The logs:

> Updating xiaomi_miot sensor took longer than the scheduled update interval 0:00:30
> 
> 5:57:57 PM – (WARNING) Sensor - message first occurred at July 19, 2021, 9:24:51 PM and shows up 2414 times
> 
> Updating xiaomi_miot vacuum took longer than the scheduled update interval 0:01:00
> 
> 5:57:55 PM – (WARNING) Vacuum - message first occurred at July 19, 2021, 9:50:53 PM and shows up 1172 times
> 
> Updating xiaomi_miot media_player took longer than the scheduled update interval 0:01:00
> 
> 5:57:55 PM – (WARNING) Media player - message first occurred at July 19, 2021, 9:25:53 PM and shows up 1195 times

These entities (sensor.alo_vera_plant_monitor_*) seem to be working well, and the state values are all from Xiaomi Cloud.

It was not updated during the last 2 days.


the intergration was working only for a short while.
I also noted that my vaccum is not working anymore, it might be a more general problem with the intergration.
image

You should use debug level logs for this component and observe logs like Got new state from Alo vera Plant Monitor....
As for the vacuum, please show me full state attributes.

Ok I have put this:

logger:

  default: warning

  logs:

    custom_components.xiaomi_miot: debug

I restart seem to have fixed the problem with the flowers, I at least had some update from them.
The xiaomi_miot media_player, is not turned off, so it makes sense that it’s not updating.

2021-07-21 16:50:31 WARNING (MainThread) [homeassistant.helpers.entity] Update of vacuum.eva_robot_cleaner is taking over 10 seconds
2021-07-21 16:50:39 DEBUG (SyncWorker_19) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: miotspec/prop/get {'params': [{'did': '408367736', 'siid': 2, 'piid': 1}, {'did': '408367736', 'siid': 2, 'piid': 2}, {'did': '408367736', 'siid': 2, 'piid': 4}, {'did': '408367736', 'siid': 2, 'piid': 8}, {'did': '408367736', 'siid': 2, 'piid': 10}, {'did': '408367736', 'siid': 14, 'piid': 1}, {'did': '408367736', 'siid': 13, 'piid': 2}, {'did': '408367736', 'siid': 13, 'piid': 3}, {'did': '408367736', 'siid': 13, 'piid': 4}, {'did': '408367736', 'siid': 13, 'piid': 5}, {'did': '408367736', 'siid': 13, 'piid': 6}, {'did': '408367736', 'siid': 13, 'piid': 7}, {'did': '408367736', 'siid': 13, 'piid': 8}, {'did': '408367736', 'siid': 8, 'piid': 1}, {'did': '408367736', 'siid': 8, 'piid': 2}, {'did': '408367736', 'siid': 8, 'piid': 6}, {'did': '408367736', 'siid': 8, 'piid': 7}, {'did': '408367736', 'siid': 8, 'piid': 8}, {'did': '408367736', 'siid': 8, 'piid': 9}, {'did': '408367736', 'siid': 8, 'piid': 10}, {'did': '408367736', 'siid': 8, 'piid': 11}, {'did': '408367736', 'siid': 8, 'piid': 13}, {'did': '408367736', 'siid': 8, 'piid': 14}, {'did': '408367736', 'siid': 8, 'piid': 18}, {'did': '408367736', 'siid': 8, 'piid': 19}, {'did': '408367736', 'siid': 8, 'piid': 20}, {'did': '408367736', 'siid': 8, 'piid': 21}, {'did': '408367736', 'siid': 8, 'piid': 22}, {'did': '408367736', 'siid': 8, 'piid': 23}, {'did': '408367736', 'siid': 8, 'piid': 24}, {'did': '408367736', 'siid': 8, 'piid': 25}, {'did': '408367736', 'siid': 8, 'piid': 26}, {'did': '408367736', 'siid': 8, 'piid': 28}, {'did': '408367736', 'siid': 8, 'piid': 29}, {'did': '408367736', 'siid': 8, 'piid': 30}, {'did': '408367736', 'siid': 15, 'piid': 1}, {'did': '408367736', 'siid': 15, 'piid': 2}, {'did': '408367736', 'siid': 12, 'piid': 1}, {'did': '408367736', 'siid': 12, 'piid': 2}, {'did': '408367736', 'siid': 11, 'piid': 1}, {'did': '408367736', 'siid': 11, 'piid': 2}, {'did': '408367736', 'siid': 10, 'piid': 1}, {'did': '408367736', 'siid': 10, 'piid': 2}, {'did': '408367736', 'siid': 9, 'piid': 1}, {'did': '408367736', 'siid': 9, 'piid': 2}, {'did': '408367736', 'siid': 3, 'piid': 1}, {'did': '408367736', 'siid': 3, 'piid': 2}]} result: {"code":0,"message":"","result":[{"did":"408367736","siid":2,"piid":1,"value":9,"code":0,"updateTime":1626804987},{"did":"408367736","siid":2,"piid":2,"value":0,"code":0,"updateTime":1626523681},{"did":"408367736","siid":2,"piid":4,"value":3,"code":0,"updateTime":1626523681},{"did":"408367736","siid":2,"piid":8,"value":0,"code":0,"updateTime":1626523682},{"did":"408367736","siid":2,"piid":10,"value":1,"code":0,"updateTime":1626879039},{"did":"408367736","siid":14,"piid":1,"value":0,"code":0,"updateTime":1626803983},{"did":"408367736","siid":13,"piid":2,"code":-704030013},{"did":"408367736","siid":13,"piid":3,"code":-704030013},{"did":"408367736","siid":13,"piid":4,"code":-704030013},{"did":"408367736","siid":13,"piid":5,"value":false,"code":0,"updateTime":1626523681},{"did":"408367736","siid":13,"piid":6,"code":-704030013},{"did":"408367736","siid":13,"piid":7,"value":false,"code":0,"updateTime":1626523682},{"did":"408367736","siid":13,"piid":8,"value":0,"code":0,"updateTime":1626636951},{"did":"408367736","siid":8,"piid":1,"value":false,"code":0,"updateTime":1626523681},{"did":"408367736","siid":8,"piid":2,"value":3,"code":0,"updateTime":1626523681},{"did":"408367736","siid":8,"piid":6,"value":"{\"time\":[],\"tz\":2,\"tzs\":7200}","code":0,"updateTime":1626879039},{"did":"408367736","siid":8,"piid":7,"value":6,"code":0,"updateTime":1626803948},{"did":"408367736","siid":8,"piid":8,"value":"1693058282","code":0,"updateTime":1626564239},{"did":"408367736","siid":8,"piid":9,"value":false,"code":0,"updateTime":1626523681},{"did":"408367736","siid":8,"piid":10,"value":"{\"time\":[],\"tz\":2,\"tzs\":7200}","code":0,"updateTime":1626879039},{"did":"408367736","siid":8,"piid":11,"value":0,"code":0,"updateTime":1626523681},{"did":"408367736","siid":8,"piid":13,"value":13895,"code":0,"updateTime":1626804048},{"did":"408367736","siid":8,"piid":14,"value":144,"code":0,"updateTime":1626804048},{"did":"408367736","siid":8,"piid":18,"value":18,"code":0,"updateTime":1626804048},{"did":"408367736","siid":8,"piid":19,"value":450,"code":0,"updateTime":1626803960},{"did":"408367736","siid":8,"piid":20,"value":false,"code":0,"updateTime":1626636951},{"did":"408367736","siid":8,"piid":21,"value":false,"code":0,"updateTime":1626523681},{"did":"408367736","siid":8,"piid":22,"value":false,"code":0,"updateTime":1626523682},{"did":"408367736","siid":8,"piid":23,"value":false,"code":0,"updateTime":1626523682},{"did":"408367736","siid":8,"piid":24,"value":true,"code":0,"updateTime":1626523682},{"did":"408367736","siid":8,"piid":25,"value":false,"code":0,"updateTime":1626523682},{"did":"408367736","siid":8,"piid":26,"value":"girl_en","code":0,"updateTime":1626879039},{"did":"408367736","siid":8,"piid":28,"code":-704220008},{"did":"408367736","siid":8,"piid":29,"value":102,"code":0,"updateTime":1626710600},{"did":"408367736","siid":8,"piid":30,"value":"file not exist !!!","code":0,"updateTime":1626879039},{"did":"408367736","siid":15,"piid":1,"value":1569,"code":0,"updateTime":1626804048},{"did":"408367736","siid":15,"piid":2,"value":87,"code":0,"updateTime":1626804048},{"did":"408367736","siid":12,"piid":1,"code":-704220043},{"did":"408367736","siid":12,"piid":2,"value":98,"code":0,"updateTime":1626804048},{"did":"408367736","siid":11,"piid":1,"value":17769,"code":0,"updateTime":1626804048},{"did":"408367736","siid":11,"piid":2,"value":98,"code":0,"updateTime":1626804048},{"did":"408367736","siid":10,"piid":1,"value":97,"code":0,"updateTime":1626804048},{"did":"408367736","siid":10,"piid":2,"value":8769,"code":0,"updateTime":1626804048},{"did":"408367736","siid":9,"piid":1,"value":59,"code":0,"updateTime":1626523681},{"did":"408367736","siid":9,"piid":2,"value":false,"code":0,"updateTime":1626523681},{"did":"408367736","siid":3,"piid":1,"value":100,"code":0,"updateTime":1626804982},{"did":"408367736","siid":3,"piid":2,"value":1,"code":0,"updateTime":1626879039}]}
2021-07-21 16:50:39 DEBUG (MainThread) [custom_components.xiaomi_miot] Got new state from Eva Robot Cleaner: {'vacuum.status': 9, 'vacuum.fault': 0, 'vacuum.mode': 3, 'vacuum.sweep_type': 0, 'vacuum.on': 1, 'sweep.sweep_mode': 0, 'map.clean_path.error': -704030013, 'map.restricted_zone.error': -704030013, 'map.auto_area.error': -704030013, 'map.map_memory': False, 'map.map_name.error': -704030013, 'map.use_auto_area': False, 'map.path_type': 0, 'custom.mop': False, 'custom.work_station_freq': 3, 'custom.timing': '{"time":[],"tz":2,"tzs":7200}', 'custom.clean_area': 6, 'custom.uid': '1693058282', 'custom.auto_boost': False, 'custom.forbid_mode': '{"time":[],"tz":2,"tzs":7200}', 'custom.water_level': 0, 'custom.total_clean_time': 13895, 'custom.total_clean_areas': 144, 'custom.clean_counts': 18, 'custom.clean_time': 450, 'custom.double_clean': False, 'custom.edge_sweep': False, 'custom.led_switch': False, 'custom.lidar_collision': False, 'custom.station_key': True, 'custom.station_led': False, 'custom.current_audio': 'girl_en', 'custom.progress.error': -704220008, 'custom.station_type': 102, 'custom.voice_conf': 'file not exist !!!', 'brush_cleaner-15.brush_left_time': 1569, 'brush_cleaner-15.brush_life_level': 87, 'brush_cleaner-12.brush_left_time.error': -704220043, 'brush_cleaner-12.brush_life_level': 98, 'brush_cleaner.brush_left_time': 17769, 'brush_cleaner.brush_life_level': 98, 'filter.filter_life_level': 97, 'filter.filter_left_time': 8769, 'speaker.volume': 59, 'speaker.mute': False, 'battery.battery_level': 100, 'battery.charging_state': 1, 'state_updater': 'cloud', 'sub_entities': ['filter-10.filter_life_level-1', 'filter-10.filter_left_time-2', 'battery-3.battery_level-1', 'battery-3.charging_state-2', 'brush_cleaner-11.brush_left_time-1', 'brush_cleaner-11.brush_life_level-2', 'brush_cleaner-12.brush_life_level-2', 'brush_cleaner-15.brush_left_time-1', 'brush_cleaner-15.brush_life_level-2']}
2021-07-21 16:50:47 WARNING (MainThread) [homeassistant.components.sensor] Updating xiaomi_miot sensor took longer than the scheduled update interval 0:00:30
2021-07-21 16:50:53 WARNING (MainThread) [homeassistant.components.media_player] Updating xiaomi_miot media_player took longer than the scheduled update interval 0:01:00
2021-07-21 16:51:17 WARNING (MainThread) [homeassistant.components.sensor] Updating xiaomi_miot sensor took longer than the scheduled update interval 0:00:30
2021-07-21 16:51:24 DEBUG (SyncWorker_5) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: miotspec/prop/get {'params': [{'did': '408367736', 'siid': 2, 'piid': 1}, {'did': '408367736', 'siid': 2, 'piid': 2}, {'did': '408367736', 'siid': 2, 'piid': 4}, {'did': '408367736', 'siid': 2, 'piid': 8}, {'did': '408367736', 'siid': 2, 'piid': 10}, {'did': '408367736', 'siid': 14, 'piid': 1}, {'did': '408367736', 'siid': 13, 'piid': 2}, {'did': '408367736', 'siid': 13, 'piid': 3}, {'did': '408367736', 'siid': 13, 'piid': 4}, {'did': '408367736', 'siid': 13, 'piid': 5}, {'did': '408367736', 'siid': 13, 'piid': 6}, {'did': '408367736', 'siid': 13, 'piid': 7}, {'did': '408367736', 'siid': 13, 'piid': 8}, {'did': '408367736', 'siid': 8, 'piid': 1}, {'did': '408367736', 'siid': 8, 'piid': 2}, {'did': '408367736', 'siid': 8, 'piid': 6}, {'did': '408367736', 'siid': 8, 'piid': 7}, {'did': '408367736', 'siid': 8, 'piid': 8}, {'did': '408367736', 'siid': 8, 'piid': 9}, {'did': '408367736', 'siid': 8, 'piid': 10}, {'did': '408367736', 'siid': 8, 'piid': 11}, {'did': '408367736', 'siid': 8, 'piid': 13}, {'did': '408367736', 'siid': 8, 'piid': 14}, {'did': '408367736', 'siid': 8, 'piid': 18}, {'did': '408367736', 'siid': 8, 'piid': 19}, {'did': '408367736', 'siid': 8, 'piid': 20}, {'did': '408367736', 'siid': 8, 'piid': 21}, {'did': '408367736', 'siid': 8, 'piid': 22}, {'did': '408367736', 'siid': 8, 'piid': 23}, {'did': '408367736', 'siid': 8, 'piid': 24}, {'did': '408367736', 'siid': 8, 'piid': 25}, {'did': '408367736', 'siid': 8, 'piid': 26}, {'did': '408367736', 'siid': 8, 'piid': 28}, {'did': '408367736', 'siid': 8, 'piid': 29}, {'did': '408367736', 'siid': 8, 'piid': 30}, {'did': '408367736', 'siid': 15, 'piid': 1}, {'did': '408367736', 'siid': 15, 'piid': 2}, {'did': '408367736', 'siid': 12, 'piid': 1}, {'did': '408367736', 'siid': 12, 'piid': 2}, {'did': '408367736', 'siid': 11, 'piid': 1}, {'did': '408367736', 'siid': 11, 'piid': 2}, {'did': '408367736', 'siid': 10, 'piid': 1}, {'did': '408367736', 'siid': 10, 'piid': 2}, {'did': '408367736', 'siid': 9, 'piid': 1}, {'did': '408367736', 'siid': 9, 'piid': 2}, {'did': '408367736', 'siid': 3, 'piid': 1}, {'did': '408367736', 'siid': 3, 'piid': 2}]} result: {"code":0,"message":"","result":[{"did":"408367736","siid":2,"piid":1,"value":9,"code":0,"updateTime":1626804987},{"did":"408367736","siid":2,"piid":2,"value":0,"code":0,"updateTime":1626523681},{"did":"408367736","siid":2,"piid":4,"value":3,"code":0,"updateTime":1626523681},{"did":"408367736","siid":2,"piid":8,"value":0,"code":0,"updateTime":1626523682},{"did":"408367736","siid":2,"piid":10,"value":1,"code":0,"updateTime":1626879083},{"did":"408367736","siid":14,"piid":1,"value":0,"code":0,"updateTime":1626803983},{"did":"408367736","siid":13,"piid":2,"code":-704030013},{"did":"408367736","siid":13,"piid":3,"code":-704030013},{"did":"408367736","siid":13,"piid":4,"code":-704030013},{"did":"408367736","siid":13,"piid":5,"value":false,"code":0,"updateTime":1626523681},{"did":"408367736","siid":13,"piid":6,"code":-704030013},{"did":"408367736","siid":13,"piid":7,"value":false,"code":0,"updateTime":1626523682},{"did":"408367736","siid":13,"piid":8,"value":0,"code":0,"updateTime":1626636951},{"did":"408367736","siid":8,"piid":1,"value":false,"code":0,"updateTime":1626523681},{"did":"408367736","siid":8,"piid":2,"value":3,"code":0,"updateTime":1626523681},{"did":"408367736","siid":8,"piid":6,"value":"{\"time\":[],\"tz\":2,\"tzs\":7200}","code":0,"updateTime":1626879083},{"did":"408367736","siid":8,"piid":7,"value":6,"code":0,"updateTime":1626803948},{"did":"408367736","siid":8,"piid":8,"value":"1693058282","code":0,"updateTime":1626564239},{"did":"408367736","siid":8,"piid":9,"value":false,"code":0,"updateTime":1626523681},{"did":"408367736","siid":8,"piid":10,"value":"{\"time\":[],\"tz\":2,\"tzs\":7200}","code":0,"updateTime":1626879083},{"did":"408367736","siid":8,"piid":11,"value":0,"code":0,"updateTime":1626523681},{"did":"408367736","siid":8,"piid":13,"value":13895,"code":0,"updateTime":1626804048},{"did":"408367736","siid":8,"piid":14,"value":144,"code":0,"updateTime":1626804048},{"did":"408367736","siid":8,"piid":18,"value":18,"code":0,"updateTime":1626804048},{"did":"408367736","siid":8,"piid":19,"value":450,"code":0,"updateTime":1626803960},{"did":"408367736","siid":8,"piid":20,"value":false,"code":0,"updateTime":1626636951},{"did":"408367736","siid":8,"piid":21,"value":false,"code":0,"updateTime":1626523681},{"did":"408367736","siid":8,"piid":22,"value":false,"code":0,"updateTime":1626523682},{"did":"408367736","siid":8,"piid":23,"value":false,"code":0,"updateTime":1626523682},{"did":"408367736","siid":8,"piid":24,"value":true,"code":0,"updateTime":1626523682},{"did":"408367736","siid":8,"piid":25,"value":false,"code":0,"updateTime":1626523682},{"did":"408367736","siid":8,"piid":26,"value":"girl_en","code":0,"updateTime":1626879083},{"did":"408367736","siid":8,"piid":28,"code":-704220008},{"did":"408367736","siid":8,"piid":29,"value":102,"code":0,"updateTime":1626710600},{"did":"408367736","siid":8,"piid":30,"value":"file not exist !!!","code":0,"updateTime":1626879083},{"did":"408367736","siid":15,"piid":1,"value":1569,"code":0,"updateTime":1626804048},{"did":"408367736","siid":15,"piid":2,"value":87,"code":0,"updateTime":1626804048},{"did":"408367736","siid":12,"piid":1,"code":-704220043},{"did":"408367736","siid":12,"piid":2,"value":98,"code":0,"updateTime":1626804048},{"did":"408367736","siid":11,"piid":1,"value":17769,"code":0,"updateTime":1626804048},{"did":"408367736","siid":11,"piid":2,"value":98,"code":0,"updateTime":1626804048},{"did":"408367736","siid":10,"piid":1,"value":97,"code":0,"updateTime":1626804048},{"did":"408367736","siid":10,"piid":2,"value":8769,"code":0,"updateTime":1626804048},{"did":"408367736","siid":9,"piid":1,"value":59,"code":0,"updateTime":1626523681},{"did":"408367736","siid":9,"piid":2,"value":false,"code":0,"updateTime":1626523681},{"did":"408367736","siid":3,"piid":1,"value":100,"code":0,"updateTime":1626804982},{"did":"408367736","siid":3,"piid":2,"value":1,"code":0,"updateTime":1626879083}]}
2021-07-21 16:51:24 DEBUG (MainThread) [custom_components.xiaomi_miot] Got new state from Eva Robot Cleaner: {'vacuum.status': 9, 'vacuum.fault': 0, 'vacuum.mode': 3, 'vacuum.sweep_type': 0, 'vacuum.on': 1, 'sweep.sweep_mode': 0, 'map.clean_path.error': -704030013, 'map.restricted_zone.error': -704030013, 'map.auto_area.error': -704030013, 'map.map_memory': False, 'map.map_name.error': -704030013, 'map.use_auto_area': False, 'map.path_type': 0, 'custom.mop': False, 'custom.work_station_freq': 3, 'custom.timing': '{"time":[],"tz":2,"tzs":7200}', 'custom.clean_area': 6, 'custom.uid': '1693058282', 'custom.auto_boost': False, 'custom.forbid_mode': '{"time":[],"tz":2,"tzs":7200}', 'custom.water_level': 0, 'custom.total_clean_time': 13895, 'custom.total_clean_areas': 144, 'custom.clean_counts': 18, 'custom.clean_time': 450, 'custom.double_clean': False, 'custom.edge_sweep': False, 'custom.led_switch': False, 'custom.lidar_collision': False, 'custom.station_key': True, 'custom.station_led': False, 'custom.current_audio': 'girl_en', 'custom.progress.error': -704220008, 'custom.station_type': 102, 'custom.voice_conf': 'file not exist !!!', 'brush_cleaner-15.brush_left_time': 1569, 'brush_cleaner-15.brush_life_level': 87, 'brush_cleaner-12.brush_left_time.error': -704220043, 'brush_cleaner-12.brush_life_level': 98, 'brush_cleaner.brush_left_time': 17769, 'brush_cleaner.brush_life_level': 98, 'filter.filter_life_level': 97, 'filter.filter_left_time': 8769, 'speaker.volume': 59, 'speaker.mute': False, 'battery.battery_level': 100, 'battery.charging_state': 1, 'state_updater': 'cloud', 'sub_entities': ['filter-10.filter_life_level-1', 'filter-10.filter_left_time-2', 'battery-3.battery_level-1', 'battery-3.charging_state-2', 'brush_cleaner-11.brush_left_time-1', 'brush_cleaner-11.brush_life_level-2', 'brush_cleaner-12.brush_life_level-2', 'brush_cleaner-15.brush_left_time-1', 'brush_cleaner-15.brush_life_level-2']}
2021-07-21 16:51:47 WARNING (MainThread) [homeassistant.components.sensor] Updating xiaomi_miot sensor took longer than the scheduled update interval 0:00:30
2021-07-21 16:51:53 WARNING (MainThread) [homeassistant.components.media_player] Updating xiaomi_miot media_player took longer than the scheduled update interval 0:01:00
2021-07-21 16:52:17 WARNING (MainThread) [homeassistant.components.sensor] Updating xiaomi_miot sensor took longer than the scheduled update interval 0:00:30
2021-07-21 16:52:24 DEBUG (SyncWorker_8) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: miotspec/prop/get {'params': [{'did': '408367736', 'siid': 2, 'piid': 1}, {'did': '408367736', 'siid': 2, 'piid': 2}, {'did': '408367736', 'siid': 2, 'piid': 4}, {'did': '408367736', 'siid': 2, 'piid': 8}, {'did': '408367736', 'siid': 2, 'piid': 10}, {'did': '408367736', 'siid': 14, 'piid': 1}, {'did': '408367736', 'siid': 13, 'piid': 2}, {'did': '408367736', 'siid': 13, 'piid': 3}, {'did': '408367736', 'siid': 13, 'piid': 4}, {'did': '408367736', 'siid': 13, 'piid': 5}, {'did': '408367736', 'siid': 13, 'piid': 6}, {'did': '408367736', 'siid': 13, 'piid': 7}, {'did': '408367736', 'siid': 13, 'piid': 8}, {'did': '408367736', 'siid': 8, 'piid': 1}, {'did': '408367736', 'siid': 8, 'piid': 2}, {'did': '408367736', 'siid': 8, 'piid': 6}, {'did': '408367736', 'siid': 8, 'piid': 7}, {'did': '408367736', 'siid': 8, 'piid': 8}, {'did': '408367736', 'siid': 8, 'piid': 9}, {'did': '408367736', 'siid': 8, 'piid': 10}, {'did': '408367736', 'siid': 8, 'piid': 11}, {'did': '408367736', 'siid': 8, 'piid': 13}, {'did': '408367736', 'siid': 8, 'piid': 14}, {'did': '408367736', 'siid': 8, 'piid': 18}, {'did': '408367736', 'siid': 8, 'piid': 19}, {'did': '408367736', 'siid': 8, 'piid': 20}, {'did': '408367736', 'siid': 8, 'piid': 21}, {'did': '408367736', 'siid': 8, 'piid': 22}, {'did': '408367736', 'siid': 8, 'piid': 23}, {'did': '408367736', 'siid': 8, 'piid': 24}, {'did': '408367736', 'siid': 8, 'piid': 25}, {'did': '408367736', 'siid': 8, 'piid': 26}, {'did': '408367736', 'siid': 8, 'piid': 28}, {'did': '408367736', 'siid': 8, 'piid': 29}, {'did': '408367736', 'siid': 8, 'piid': 30}, {'did': '408367736', 'siid': 15, 'piid': 1}, {'did': '408367736', 'siid': 15, 'piid': 2}, {'did': '408367736', 'siid': 12, 'piid': 1}, {'did': '408367736', 'siid': 12, 'piid': 2}, {'did': '408367736', 'siid': 11, 'piid': 1}, {'did': '408367736', 'siid': 11, 'piid': 2}, {'did': '408367736', 'siid': 10, 'piid': 1}, {'did': '408367736', 'siid': 10, 'piid': 2}, {'did': '408367736', 'siid': 9, 'piid': 1}, {'did': '408367736', 'siid': 9, 'piid': 2}, {'did': '408367736', 'siid': 3, 'piid': 1}, {'did': '408367736', 'siid': 3, 'piid': 2}]} result: {"code":0,"message":"","result":[{"did":"408367736","siid":2,"piid":1,"value":9,"code":0,"updateTime":1626804987},{"did":"408367736","siid":2,"piid":2,"value":0,"code":0,"updateTime":1626523681},{"did":"408367736","siid":2,"piid":4,"value":3,"code":0,"updateTime":1626523681},{"did":"408367736","siid":2,"piid":8,"value":0,"code":0,"updateTime":1626523682},{"did":"408367736","siid":2,"piid":10,"value":1,"code":0,"updateTime":1626879144},{"did":"408367736","siid":14,"piid":1,"value":0,"code":0,"updateTime":1626803983},{"did":"408367736","siid":13,"piid":2,"code":-704030013},{"did":"408367736","siid":13,"piid":3,"code":-704030013},{"did":"408367736","siid":13,"piid":4,"code":-704030013},{"did":"408367736","siid":13,"piid":5,"value":false,"code":0,"updateTime":1626523681},{"did":"408367736","siid":13,"piid":6,"code":-704030013},{"did":"408367736","siid":13,"piid":7,"value":false,"code":0,"updateTime":1626523682},{"did":"408367736","siid":13,"piid":8,"value":0,"code":0,"updateTime":1626636951},{"did":"408367736","siid":8,"piid":1,"value":false,"code":0,"updateTime":1626523681},{"did":"408367736","siid":8,"piid":2,"value":3,"code":0,"updateTime":1626523681},{"did":"408367736","siid":8,"piid":6,"value":"{\"time\":[],\"tz\":2,\"tzs\":7200}","code":0,"updateTime":1626879144},{"did":"408367736","siid":8,"piid":7,"value":6,"code":0,"updateTime":1626803948},{"did":"408367736","siid":8,"piid":8,"value":"1693058282","code":0,"updateTime":1626564239},{"did":"408367736","siid":8,"piid":9,"value":false,"code":0,"updateTime":1626523681},{"did":"408367736","siid":8,"piid":10,"value":"{\"time\":[],\"tz\":2,\"tzs\":7200}","code":0,"updateTime":1626879144},{"did":"408367736","siid":8,"piid":11,"value":0,"code":0,"updateTime":1626523681},{"did":"408367736","siid":8,"piid":13,"value":13895,"code":0,"updateTime":1626804048},{"did":"408367736","siid":8,"piid":14,"value":144,"code":0,"updateTime":1626804048},{"did":"408367736","siid":8,"piid":18,"value":18,"code":0,"updateTime":1626804048},{"did":"408367736","siid":8,"piid":19,"value":450,"code":0,"updateTime":1626803960},{"did":"408367736","siid":8,"piid":20,"value":false,"code":0,"updateTime":1626636951},{"did":"408367736","siid":8,"piid":21,"value":false,"code":0,"updateTime":1626523681},{"did":"408367736","siid":8,"piid":22,"value":false,"code":0,"updateTime":1626523682},{"did":"408367736","siid":8,"piid":23,"value":false,"code":0,"updateTime":1626523682},{"did":"408367736","siid":8,"piid":24,"value":true,"code":0,"updateTime":1626523682},{"did":"408367736","siid":8,"piid":25,"value":false,"code":0,"updateTime":1626523682},{"did":"408367736","siid":8,"piid":26,"value":"girl_en","code":0,"updateTime":1626879144},{"did":"408367736","siid":8,"piid":28,"code":-704220008},{"did":"408367736","siid":8,"piid":29,"value":102,"code":0,"updateTime":1626710600},{"did":"408367736","siid":8,"piid":30,"value":"file not exist !!!","code":0,"updateTime":1626879144},{"did":"408367736","siid":15,"piid":1,"value":1569,"code":0,"updateTime":1626804048},{"did":"408367736","siid":15,"piid":2,"value":87,"code":0,"updateTime":1626804048},{"did":"408367736","siid":12,"piid":1,"code":-704220043},{"did":"408367736","siid":12,"piid":2,"value":98,"code":0,"updateTime":1626804048},{"did":"408367736","siid":11,"piid":1,"value":17769,"code":0,"updateTime":1626804048},{"did":"408367736","siid":11,"piid":2,"value":98,"code":0,"updateTime":1626804048},{"did":"408367736","siid":10,"piid":1,"value":97,"code":0,"updateTime":1626804048},{"did":"408367736","siid":10,"piid":2,"value":8769,"code":0,"updateTime":1626804048},{"did":"408367736","siid":9,"piid":1,"value":59,"code":0,"updateTime":1626523681},{"did":"408367736","siid":9,"piid":2,"value":false,"code":0,"updateTime":1626523681},{"did":"408367736","siid":3,"piid":1,"value":100,"code":0,"updateTime":1626804982},{"did":"408367736","siid":3,"piid":2,"value":1,"code":0,"updateTime":1626879144}]}
2021-07-21 16:52:24 DEBUG (MainThread) [custom_components.xiaomi_miot] Got new state from Eva Robot Cleaner: {'vacuum.status': 9, 'vacuum.fault': 0, 'vacuum.mode': 3, 'vacuum.sweep_type': 0, 'vacuum.on': 1, 'sweep.sweep_mode': 0, 'map.clean_path.error': -704030013, 'map.restricted_zone.error': -704030013, 'map.auto_area.error': -704030013, 'map.map_memory': False, 'map.map_name.error': -704030013, 'map.use_auto_area': False, 'map.path_type': 0, 'custom.mop': False, 'custom.work_station_freq': 3, 'custom.timing': '{"time":[],"tz":2,"tzs":7200}', 'custom.clean_area': 6, 'custom.uid': '1693058282', 'custom.auto_boost': False, 'custom.forbid_mode': '{"time":[],"tz":2,"tzs":7200}', 'custom.water_level': 0, 'custom.total_clean_time': 13895, 'custom.total_clean_areas': 144, 'custom.clean_counts': 18, 'custom.clean_time': 450, 'custom.double_clean': False, 'custom.edge_sweep': False, 'custom.led_switch': False, 'custom.lidar_collision': False, 'custom.station_key': True, 'custom.station_led': False, 'custom.current_audio': 'girl_en', 'custom.progress.error': -704220008, 'custom.station_type': 102, 'custom.voice_conf': 'file not exist !!!', 'brush_cleaner-15.brush_left_time': 1569, 'brush_cleaner-15.brush_life_level': 87, 'brush_cleaner-12.brush_left_time.error': -704220043, 'brush_cleaner-12.brush_life_level': 98, 'brush_cleaner.brush_left_time': 17769, 'brush_cleaner.brush_life_level': 98, 'filter.filter_life_level': 97, 'filter.filter_left_time': 8769, 'speaker.volume': 59, 'speaker.mute': False, 'battery.battery_level': 100, 'battery.charging_state': 1, 'state_updater': 'cloud', 'sub_entities': ['filter-10.filter_life_level-1', 'filter-10.filter_left_time-2', 'battery-3.battery_level-1', 'battery-3.charging_state-2', 'brush_cleaner-11.brush_left_time-1', 'brush_cleaner-11.brush_life_level-2', 'brush_cleaner-12.brush_life_level-2', 'brush_cleaner-15.brush_left_time-1', 'brush_cleaner-15.brush_life_level-2']}

After some time it seems that the integration stops working in my setup.
Pi4 I have no clue of what my installations is called due to ever chaning names. It’s the noob installation with supervisor.

image


2021-07-22 09:13:52 WARNING (MainThread) [homeassistant.components.sensor] Updating xiaomi_miot sensor took longer than the scheduled update interval 0:00:30

2021-07-22 09:13:54 WARNING (MainThread) [homeassistant.components.media_player] Updating xiaomi_miot media_player took longer than the scheduled update interval 0:01:00

2021-07-22 09:14:16 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'click' when rendering '{{ value_json.click }}'

2021-07-22 09:14:22 WARNING (MainThread) [homeassistant.components.sensor] Updating xiaomi_miot sensor took longer than the scheduled update interval 0:00:30

2021-07-22 09:14:23 WARNING (MainThread) [homeassistant.components.vacuum] Updating xiaomi_miot vacuum took longer than the scheduled update interval 0:01:00

2021-07-22 09:14:52 WARNING (MainThread) [homeassistant.components.sensor] Updating xiaomi_miot sensor took longer than the scheduled update interval 0:00:30

2021-07-22 09:14:54 WARNING (MainThread) [homeassistant.components.media_player] Updating xiaomi_miot media_player took longer than the scheduled update interval 0:01:00

2021-07-22 09:15:22 WARNING (MainThread) [homeassistant.components.sensor] Updating xiaomi_miot sensor took longer than the scheduled update interval 0:00:30

2021-07-22 09:15:23 WARNING (MainThread) [homeassistant.components.vacuum] Updating xiaomi_miot vacuum took longer than the scheduled update interval 0:01:00

I reloaded the integration and everything seems to come online again:

2021-07-22 11:46:20 DEBUG (MainThread) [custom_components.xiaomi_miot] Got new state from Kærlighedspalme Plant Monitor Relative Humidity: {'plant_monitor.relative_humidity': 11, 'plant_monitor.soil_ec': 65, 'plant_monitor.illumination': 338, 'environment.temperature': 24.3, 'state_updater': 'cloud'}

2021-07-22 11:46:27 DEBUG (SyncWorker_22) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: miotspec/prop/get {'params': [{'did': '408367736', 'siid': 2, 'piid': 1}, {'did': '408367736', 'siid': 2, 'piid': 2}, {'did': '408367736', 'siid': 2, 'piid': 4}, {'did': '408367736', 'siid': 2, 'piid': 8}, {'did': '408367736', 'siid': 2, 'piid': 10}, {'did': '408367736', 'siid': 14, 'piid': 1}, {'did': '408367736', 'siid': 13, 'piid': 2}, {'did': '408367736', 'siid': 13, 'piid': 3}, {'did': '408367736', 'siid': 13, 'piid': 4}, {'did': '408367736', 'siid': 13, 'piid': 5}, {'did': '408367736', 'siid': 13, 'piid': 6}, {'did': '408367736', 'siid': 13, 'piid': 7}, {'did': '408367736', 'siid': 13, 'piid': 8}, {'did': '408367736', 'siid': 8, 'piid': 1}, {'did': '408367736', 'siid': 8, 'piid': 2}, {'did': '408367736', 'siid': 8, 'piid': 6}, {'did': '408367736', 'siid': 8, 'piid': 7}, {'did': '408367736', 'siid': 8, 'piid': 8}, {'did': '408367736', 'siid': 8, 'piid': 9}, {'did': '408367736', 'siid': 8, 'piid': 10}, {'did': '408367736', 'siid': 8, 'piid': 11}, {'did': '408367736', 'siid': 8, 'piid': 13}, {'did': '408367736', 'siid': 8, 'piid': 14}, {'did': '408367736', 'siid': 8, 'piid': 18}, {'did': '408367736', 'siid': 8, 'piid': 19}, {'did': '408367736', 'siid': 8, 'piid': 20}, {'did': '408367736', 'siid': 8, 'piid': 21}, {'did': '408367736', 'siid': 8, 'piid': 22}, {'did': '408367736', 'siid': 8, 'piid': 23}, {'did': '408367736', 'siid': 8, 'piid': 24}, {'did': '408367736', 'siid': 8, 'piid': 25}, {'did': '408367736', 'siid': 8, 'piid': 26}, {'did': '408367736', 'siid': 8, 'piid': 28}, {'did': '408367736', 'siid': 8, 'piid': 29}, {'did': '408367736', 'siid': 8, 'piid': 30}, {'did': '408367736', 'siid': 15, 'piid': 1}, {'did': '408367736', 'siid': 15, 'piid': 2}, {'did': '408367736', 'siid': 12, 'piid': 1}, {'did': '408367736', 'siid': 12, 'piid': 2}, {'did': '408367736', 'siid': 11, 'piid': 1}, {'did': '408367736', 'siid': 11, 'piid': 2}, {'did': '408367736', 'siid': 10, 'piid': 1}, {'did': '408367736', 'siid': 10, 'piid': 2}, {'did': '408367736', 'siid': 9, 'piid': 1}, {'did': '408367736', 'siid': 9, 'piid': 2}, {'did': '408367736', 'siid': 3, 'piid': 1}, {'did': '408367736', 'siid': 3, 'piid': 2}]} result: {"code":0,"message":"","result":[{"did":"408367736","siid":2,"piid":1,"value":2,"code":0,"updateTime":1626947126},{"did":"408367736","siid":2,"piid":2,"value":10,"code":0,"updateTime":1626938093},{"did":"408367736","siid":2,"piid":4,"value":3,"code":0,"updateTime":1626523681},{"did":"408367736","siid":2,"piid":8,"value":0,"code":0,"updateTime":1626523682},{"did":"408367736","siid":2,"piid":10,"value":1,"code":0,"updateTime":1626947187},{"did":"408367736","siid":14,"piid":1,"value":0,"code":0,"updateTime":1626938696},{"did":"408367736","siid":13,"piid":2,"code":-704030013},{"did":"408367736","siid":13,"piid":3,"code":-704030013},{"did":"408367736","siid":13,"piid":4,"code":-704030013},{"did":"408367736","siid":13,"piid":5,"value":false,"code":0,"updateTime":1626523681},{"did":"408367736","siid":13,"piid":6,"code":-704030013},{"did":"408367736","siid":13,"piid":7,"value":false,"code":0,"updateTime":1626523682},{"did":"408367736","siid":13,"piid":8,"value":0,"code":0,"updateTime":1626636951},{"did":"408367736","siid":8,"piid":1,"value":false,"code":0,"updateTime":1626523681},{"did":"408367736","siid":8,"piid":2,"value":3,"code":0,"updateTime":1626523681},{"did":"408367736","siid":8,"piid":6,"value":"{\"time\":[],\"tz\":2,\"tzs\":7200}","code":0,"updateTime":1626947187},{"did":"408367736","siid":8,"piid":7,"value":0,"code":0,"updateTime":1626937897},{"did":"408367736","siid":8,"piid":8,"value":"1693058282","code":0,"updateTime":1626947126},{"did":"408367736","siid":8,"piid":9,"value":false,"code":0,"updateTime":1626523681},{"did":"408367736","siid":8,"piid":10,"value":"{\"time\":[],\"tz\":2,\"tzs\":7200}","code":0,"updateTime":1626947187},{"did":"408367736","siid":8,"piid":11,"value":0,"code":0,"updateTime":1626523681},{"did":"408367736","siid":8,"piid":13,"value":14088,"code":0,"updateTime":1626947126},{"did":"408367736","siid":8,"piid":14,"value":144,"code":0,"updateTime":1626947126},{"did":"408367736","siid":8,"piid":18,"value":19,"code":0,"updateTime":1626947126},{"did":"408367736","siid":8,"piid":19,"value":180,"code":0,"updateTime":1626938079},{"did":"408367736","siid":8,"piid":20,"value":false,"code":0,"updateTime":1626636951},{"did":"408367736","siid":8,"piid":21,"value":false,"code":0,"updateTime":1626523681},{"did":"408367736","siid":8,"piid":22,"value":false,"code":0,"updateTime":1626523682},{"did":"408367736","siid":8,"piid":23,"value":false,"code":0,"updateTime":1626523682},{"did":"408367736","siid":8,"piid":24,"value":true,"code":0,"updateTime":1626523682},{"did":"408367736","siid":8,"piid":25,"value":false,"code":0,"updateTime":1626523682},{"did":"408367736","siid":8,"piid":26,"value":"girl_en","code":0,"updateTime":1626947187},{"did":"408367736","siid":8,"piid":28,"code":-704220008},{"did":"408367736","siid":8,"piid":29,"value":102,"code":0,"updateTime":1626710600},{"did":"408367736","siid":8,"piid":30,"value":"file not exist !!!","code":0,"updateTime":1626947187},{"did":"408367736","siid":15,"piid":1,"value":1566,"code":0,"updateTime":1626947126},{"did":"408367736","siid":15,"piid":2,"value":87,"code":0,"updateTime":1626947126},{"did":"408367736","siid":12,"piid":1,"code":-704220043},{"did":"408367736","siid":12,"piid":2,"value":98,"code":0,"updateTime":1626947126},{"did":"408367736","siid":11,"piid":1,"value":17766,"code":0,"updateTime":1626947126},{"did":"408367736","siid":11,"piid":2,"value":98,"code":0,"updateTime":1626947126},{"did":"408367736","siid":10,"piid":1,"value":97,"code":0,"updateTime":1626947126},{"did":"408367736","siid":10,"piid":2,"value":8766,"code":0,"updateTime":1626947126},{"did":"408367736","siid":9,"piid":1,"value":59,"code":0,"updateTime":1626523681},{"did":"408367736","siid":9,"piid":2,"value":false,"code":0,"updateTime":1626523681},{"did":"408367736","siid":3,"piid":1,"value":96,"code":0,"updateTime":1626946403},{"did":"408367736","siid":3,"piid":2,"value":2,"code":0,"updateTime":1626947187}]}

2021-07-22 11:46:27 DEBUG (MainThread) [custom_components.xiaomi_miot] Got new state from Eva Robot Cleaner: {'vacuum.status': 2, 'vacuum.fault': 10, 'vacuum.mode': 3, 'vacuum.sweep_type': 0, 'vacuum.on': 1, 'sweep.sweep_mode': 0, 'map.clean_path.error': -704030013, 'map.restricted_zone.error': -704030013, 'map.auto_area.error': -704030013, 'map.map_memory': False, 'map.map_name.error': -704030013, 'map.use_auto_area': False, 'map.path_type': 0, 'custom.mop': False, 'custom.work_station_freq': 3, 'custom.timing': '{"time":[],"tz":2,"tzs":7200}', 'custom.clean_area': 0, 'custom.uid': '1693058282', 'custom.auto_boost': False, 'custom.forbid_mode': '{"time":[],"tz":2,"tzs":7200}', 'custom.water_level': 0, 'custom.total_clean_time': 14088, 'custom.total_clean_areas': 144, 'custom.clean_counts': 19, 'custom.clean_time': 180, 'custom.double_clean': False, 'custom.edge_sweep': False, 'custom.led_switch': False, 'custom.lidar_collision': False, 'custom.station_key': True, 'custom.station_led': False, 'custom.current_audio': 'girl_en', 'custom.progress.error': -704220008, 'custom.station_type': 102, 'custom.voice_conf': 'file not exist !!!', 'brush_cleaner-15.brush_left_time': 1566, 'brush_cleaner-15.brush_life_level': 87, 'brush_cleaner-12.brush_left_time.error': -704220043, 'brush_cleaner-12.brush_life_level': 98, 'brush_cleaner.brush_left_time': 17766, 'brush_cleaner.brush_life_level': 98, 'filter.filter_life_level': 97, 'filter.filter_left_time': 8766, 'speaker.volume': 59, 'speaker.mute': False, 'battery.battery_level': 96, 'battery.charging_state': 2, 'state_updater': 'cloud'}

2021-07-22 11:46:27 DEBUG (SyncWorker_17) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: miotspec/prop/get {'params': [{'did': 'blt.3.oc1mfubk4000', 'siid': 2, 'piid': 1}, {'did': 'blt.3.oc1mfubk4000', 'siid': 2, 'piid': 2}, {'did': 'blt.3.oc1mfubk4000', 'siid': 2, 'piid': 3}, {'did': 'blt.3.oc1mfubk4000', 'siid': 3, 'piid': 2}]} result: {"code":0,"message":"","result":[{"did":"blt.3.oc1mfubk4000","siid":2,"piid":1,"value":40,"code":0,"updateTime":1626946937},{"did":"blt.3.oc1mfubk4000","siid":2,"piid":2,"value":291,"code":0,"updateTime":1626947067},{"did":"blt.3.oc1mfubk4000","siid":2,"piid":3,"value":508,"code":0,"updateTime":1626946974},{"did":"blt.3.oc1mfubk4000","siid":3,"piid":2,"value":24.4,"code":0,"updateTime":1626946801}]}

2021-07-22 11:46:27 DEBUG (MainThread) [custom_components.xiaomi_miot] Got new state from Ikea lille Plant Monitor Relative Humidity: {'plant_monitor.relative_humidity': 40, 'plant_monitor.soil_ec': 291, 'plant_monitor.illumination': 508, 'environment.temperature': 24.4, 'state_updater': 'cloud'}

2021-07-22 11:46:49 DEBUG (SyncWorker_21) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: miotspec/prop/get {'params': [{'did': 'blt.3.oc1mfubk4000', 'siid': 2, 'piid': 1}, {'did': 'blt.3.oc1mfubk4000', 'siid': 2, 'piid': 2}, {'did': 'blt.3.oc1mfubk4000', 'siid': 2, 'piid': 3}, {'did': 'blt.3.oc1mfubk4000', 'siid': 3, 'piid': 2}]} result: {"code":0,"message":"","result":[{"did":"blt.3.oc1mfubk4000","siid":2,"piid":1,"value":40,"code":0,"updateTime":1626946937},{"did":"blt.3.oc1mfubk4000","siid":2,"piid":2,"value":291,"code":0,"updateTime":1626947067},{"did":"blt.3.oc1mfubk4000","siid":2,"piid":3,"value":508,"code":0,"updateTime":1626946974},{"did":"blt.3.oc1mfubk4000","siid":3,"piid":2,"value":24.4,"code":0,"updateTime":1626946801}]}

2021-07-22 11:46:49 DEBUG (MainThread) [custom_components.xiaomi_miot] Got new state from Ikea lille Plant Monitor Relative Humidity: {'plant_monitor.relative_humidity': 40, 'plant_monitor.soil_ec': 291, 'plant_monitor.illumination': 508, 'environment.temperature': 24.4, 'state_updater': 'cloud'}

2021-07-22 11:46:49 DEBUG (SyncWorker_10) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: miotspec/prop/get {'params': [{'did': 'blt.4.12rpn65rcgc00', 'siid': 2, 'piid': 1}, {'did': 'blt.4.12rpn65rcgc00', 'siid': 2, 'piid': 2}, {'did': 'blt.4.12rpn65rcgc00', 'siid': 3, 'piid': 1}]} result: {"code":0,"message":"","result":[{"did":"blt.4.12rpn65rcgc00","siid":2,"piid":1,"code":-704002000},{"did":"blt.4.12rpn65rcgc00","siid":2,"piid":2,"code":-704002000},{"did":"blt.4.12rpn65rcgc00","siid":3,"piid":1,"code":-704002000}]}

2021-07-22 11:46:49 DEBUG (MainThread) [custom_components.xiaomi_miot] Got new state from Temperature & humidity sensor Temperature Humidity Sensor Temperature: {'temperature_humidity_sensor.temperature.error': -704002000, 'temperature_humidity_sensor.relative_humidity.error': -704002000, 'battery.battery_level.error': -704002000, 'state_updater': 'cloud'}

2021-07-22 11:46:49 DEBUG (SyncWorker_1) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: miotspec/prop/get {'params': [{'did': 'blt.3.17am2iv44e000', 'siid': 2, 'piid': 1}, {'did': 'blt.3.17am2iv44e000', 'siid': 2, 'piid': 2}, {'did': 'blt.3.17am2iv44e000', 'siid': 2, 'piid': 3}, {'did': 'blt.3.17am2iv44e000', 'siid': 3, 'piid': 2}]} result: {"code":0,"message":"","result":[{"did":"blt.3.17am2iv44e000","siid":2,"piid":1,"code":-704002000},{"did":"blt.3.17am2iv44e000","siid":2,"piid":2,"code":-704002000},{"did":"blt.3.17am2iv44e000","siid":2,"piid":3,"code":-704002000},{"did":"blt.3.17am2iv44e000","siid":3,"piid":2,"code":-704002000}]}

2021-07-22 11:46:49 DEBUG (MainThread) [custom_components.xiaomi_miot] Got new state from Ikea Maximus Plant Monitor Relative Humidity: {'plant_monitor.relative_humidity.error': -704002000, 'plant_monitor.soil_ec.error': -704002000, 'plant_monitor.illumination.error': -704002000, 'environment.temperature.error': -704002000, 'state_updater': 'cloud'}

2021-07-22 11:46:49 DEBUG (SyncWorker_19) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: miotspec/prop/get {'params': [{'did': 'blt.3.17ambpr5gec00', 'siid': 2, 'piid': 1}, {'did': 'blt.3.17ambpr5gec00', 'siid': 2, 'piid': 2}, {'did': 'blt.3.17ambpr5gec00', 'siid': 2, 'piid': 3}, {'did': 'blt.3.17ambpr5gec00', 'siid': 3, 'piid': 2}]} result: {"code":0,"message":"","result":[{"did":"blt.3.17ambpr5gec00","siid":2,"piid":1,"value":22,"code":0,"updateTime":1626930791},{"did":"blt.3.17ambpr5gec00","siid":2,"piid":2,"value":77,"code":0,"updateTime":1626946681},{"did":"blt.3.17ambpr5gec00","siid":2,"piid":3,"value":405,"code":0,"updateTime":1626947061},{"did":"blt.3.17ambpr5gec00","siid":3,"piid":2,"value":24.5,"code":0,"updateTime":1626947090}]}

2021-07-22 11:46:49 DEBUG (MainThread) [custom_components.xiaomi_miot] Got new state from Alo vera Plant Monitor Relative Humidity: {'plant_monitor.relative_humidity': 22, 'plant_monitor.soil_ec': 77, 'plant_monitor.illumination': 405, 'environment.temperature': 24.5, 'state_updater': 'cloud'}

2021-07-22 11:46:50 DEBUG (SyncWorker_6) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: miotspec/prop/get {'params': [{'did': 'blt.3.said28oc4000', 'siid': 2, 'piid': 1}, {'did': 'blt.3.said28oc4000', 'siid': 2, 'piid': 2}, {'did': 'blt.3.said28oc4000', 'siid': 2, 'piid': 3}, {'did': 'blt.3.said28oc4000', 'siid': 3, 'piid': 2}]} result: {"code":0,"message":"","result":[{"did":"blt.3.said28oc4000","siid":2,"piid":1,"value":11,"code":0,"updateTime":1626899587},{"did":"blt.3.said28oc4000","siid":2,"piid":2,"value":64,"code":0,"updateTime":1626947197},{"did":"blt.3.said28oc4000","siid":2,"piid":3,"value":338,"code":0,"updateTime":1626947179},{"did":"blt.3.said28oc4000","siid":3,"piid":2,"value":24.3,"code":0,"updateTime":1626947087}]}

2021-07-22 11:46:50 DEBUG (MainThread) [custom_components.xiaomi_miot] Got new state from Kærlighedspalme Plant Monitor Relative Humidity: {'plant_monitor.relative_humidity': 11, 'plant_monitor.soil_ec': 64, 'plant_monitor.illumination': 338, 'environment.temperature': 24.3, 'state_updater': 'cloud'}

2021-07-22 11:46:51 DEBUG (SyncWorker_22) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: miotspec/prop/get {'params': [{'did': '127738388', 'siid': 2, 'piid': 1}, {'did': '127738388', 'siid': 2, 'piid': 2}]} result: {"code":0,"message":"","result":[{"did":"127738388","siid":2,"piid":1,"value":1,"code":0,"updateTime":1626521336},{"did":"127738388","siid":2,"piid":2,"value":false,"code":0,"updateTime":1626521336}]}

2021-07-22 11:46:51 DEBUG (MainThread) [custom_components.xiaomi_miot] Got new state from SCISHARE Smart Capsule Coffee Machine Coffee Machine Status: {'coffee_machine.status': 1, 'coffee_machine.on': False, 'state_updater': 'cloud'}

2021-07-22 11:46:53 DEBUG (SyncWorker_20) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: miotspec/prop/get {'params': [{'did': 'blt.3.o4mej7f08400', 'siid': 2, 'piid': 1}, {'did': 'blt.3.o4mej7f08400', 'siid': 2, 'piid': 2}, {'did': 'blt.3.o4mej7f08400', 'siid': 2, 'piid': 3}, {'did': 'blt.3.o4mej7f08400', 'siid': 3, 'piid': 2}]} result: {"code":0,"message":"","result":[{"did":"blt.3.o4mej7f08400","siid":2,"piid":1,"value":21,"code":0,"updateTime":1626947141},{"did":"blt.3.o4mej7f08400","siid":2,"piid":2,"value":527,"code":0,"updateTime":1626947191},{"did":"blt.3.o4mej7f08400","siid":2,"piid":3,"value":400,"code":0,"updateTime":1626947172},{"did":"blt.3.o4mej7f08400","siid":3,"piid":2,"value":24.2,"code":0,"updateTime":1626947080}]}

2021-07-22 11:46:53 DEBUG (MainThread) [custom_components.xiaomi_miot] Got new state from Violinfigne Plant Monitor Relative Humidity: {'plant_monitor.relative_humidity': 21, 'plant_monitor.soil_ec': 527, 'plant_monitor.illumination': 400, 'environment.temperature': 24.2, 'state_updater': 'cloud'}

Is there any other information you like to to find? I see that the intergration is working for about one hours per restart

okay, I think your last update included some extra debugging which I tracked:

2021-08-02 18:26:44 ERROR (SyncWorker_10) [root] Error while executing request to https://api.io.mi.com/app/miotspec/prop/get :('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 445, in _make_request
    six.raise_from(e, None)
  File "", line 3, in raise_from
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 440, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/local/lib/python3.9/http/client.py", line 1345, in getresponse
    response.begin()
  File "/usr/local/lib/python3.9/http/client.py", line 307, in begin
    version, status, reason = self._read_status()
  File "/usr/local/lib/python3.9/http/client.py", line 276, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 755, in urlopen
    retries = retries.increment(
  File "/usr/local/lib/python3.9/site-packages/urllib3/util/retry.py", line 532, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/usr/local/lib/python3.9/site-packages/urllib3/packages/six.py", line 769, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 445, in _make_request
    six.raise_from(e, None)
  File "", line 3, in raise_from
  File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 440, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/local/lib/python3.9/http/client.py", line 1345, in getresponse
    response.begin()
  File "/usr/local/lib/python3.9/http/client.py", line 307, in begin
    version, status, reason = self._read_status()
  File "/usr/local/lib/python3.9/http/client.py", line 276, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/micloud/micloud.py", line 306, in request
    response = self.session.post(url, data = post_data)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 590, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 498, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

With the update of 2021 5th of august I get the messeng:
[miio.miioprotocol] Got error when receiving: timed out

I thinking if you are reading this or :smiley:

Here is some more debugging info, in hope that it will be fixed:

2021-08-26 13:49:37 DEBUG (SyncWorker_9) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: miotspec/prop/get {'params': [{'did': 'blt.3.oc1mfubk4000', 'siid': 2, 'piid': 1}, {'did': 'blt.3.oc1mfubk4000', 'siid': 2, 'piid': 2}, {'did': 'blt.3.oc1mfubk4000', 'siid': 2, 'piid': 3}, {'did': 'blt.3.oc1mfubk4000', 'siid': 3, 'piid': 2}]} result: {"code":0,"message":"","result":[{"did":"blt.3.oc1mfubk4000","siid":2,"piid":1,"value":37,"code":0,"updateTime":1629978425},{"did":"blt.3.oc1mfubk4000","siid":2,"piid":2,"value":307,"code":0,"updateTime":1629978517},{"did":"blt.3.oc1mfubk4000","siid":2,"piid":3,"value":156,"code":0,"updateTime":1629978255},{"did":"blt.3.oc1mfubk4000","siid":3,"piid":2,"value":21.9,"code":0,"updateTime":1629978205}]}
2021-08-26 13:49:37 DEBUG (MainThread) [custom_components.xiaomi_miot] Got new state from Ikea lille Plant Monitor Relative Humidity: {'plant_monitor.relative_humidity': 37, 'plant_monitor.soil_ec': 307, 'plant_monitor.illumination': 156, 'environment.temperature': 21.9, 'state_updater': 'cloud'}
2021-08-26 13:49:37 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform xiaomi_miot
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 587, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 710, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/config/custom_components/xiaomi_miot/__init__.py", line 835, in async_added_to_hass
    await super().async_added_to_hass()
  File "/config/custom_components/xiaomi_miot/__init__.py", line 667, in async_added_to_hass
    self._add_entities = self.hass.data[DOMAIN][eid].get('add_entities') or {}
KeyError: '296799926da0a85acadb8f6c0c70016b'

I think I found the problem, the states of derived entities are not update timely, I think this can be done by your own making templates:

I also struggle to send individual commands to my Dreame D9 Max Vacuum.
The Attributes are the following

image

any hint how i can tell the vacuum which room to clean. With my other mio integration I was able to use app_segment_clean but this does not work here

Hi, I’m using this component with Xiaomi Air Purifier 3C and 3H.
For 3C I’m getting pm 2.5 sensor updates pretty often (every 60s) and for 3H once per 30min.
Both purifiers where added using web UI of Home Assistant
(I had the same with 3H when using xiaomi miio integration.)
How can I update configuration to force 3H to send sensor values every 60s?

Under normal circumstances, the component will update the data every 30 ~ 60s, so there should not be 30 minutes to update the data, unless the device reports the data to the Xiaomi cloud every 30 minutes.
If you need to change the frequency, you can modify the polling interval seconds through custom attributes.

I’ve added interval_seconds to 3H pm2.5 sensor entity via customization i UI but it didn’t change anything :frowning:

One more thing, is it possible to control “favourite” mode speed?
When using ootb miio integration, purifier 3h has such option, and here there is no such option for 3h and 3c