PiotrMachowski/lovelace-xiaomi-vacuum-map-card

`attribute` not working correctly

veniplex opened this issue ยท 6 comments

Checklist

  • I have updated the card to the latest version available
  • I have cleared the cache of my browser
  • I have checked if the problem is already reported

The problem

The attribute option in the config is not functioning.

For example, this config:

...
tiles:
  - label: Main Brush
    icon: mdi:brush-variant
    attribute: props.main_brush_work_time # This is not working
...

results in:
image

What version of a card has described problem?

v2.2.4

What was the last working version card?

No response

What vacuum model do you have problems with?

roborock.vacuum.s5

Which integration do you use to control your vacuum (link)?

https://www.home-assistant.io/integrations/xiaomi_miio/

What browser (browsers/apps) does have this problem?

Chrome

What version of Home Assistant do you use?

core-2024.7.3

What type of installation are you running?

Home Assistant OS

Card's configuration

type: custom:xiaomi-vacuum-map-card
map_source:
  camera: camera.roborock_kamera
calibration_source:
  camera: true
entity: vacuum.roborock_s5
vacuum_platform: default
title: ''
two_finger_pan: true
map_locked: false
tiles:
  - label: Main Brush
    icon: mdi:brush-variant
    entity: vacuum.roborock_s5
    attribute: props.main_brush_work_time
    tooltip: Runned time
    unit: seconds
    multiplier: 1
    precision: 1
    order: 1

Javascript errors shown in the browser's console (if applicable)

No response

Additional information

No response

Does it work when you provide entity id?

...
tiles:
  - label: Main Brush
    icon: mdi:brush-variant
    entity: vacuum.roborock_s5
    attribute: props.main_brush_work_time
...

Does it work when you provide entity id?

...
tiles:
  - label: Main Brush
    icon: mdi:brush-variant
    entity: vacuum.roborock_s5
    attribute: props.main_brush_work_time
...

No, then the status is just "unknown" ๐Ÿ˜ž.
image

The tile appears, so it definitely works better.

What are attributes of vacuum.roborock_s5 entity? You can check them here:
Open your Home Assistant instance and show your state developer tools.

@PiotrMachowski here is the full list of attributes for vacuum.roborock_s5:

fan_speed_list:
  - Silent
  - Basic
  - Strong
  - Full Speed
battery_level: 100
battery_icon: mdi:battery-charging-100
fan_speed: Full Speed
model: roborock.vacuum.s5
lan_ip: [IP Address]
mac_address: [MAC Address]
entity_class: MiotRoborockVacuumEntity
home_room: Home Wohnzimmer
miot_type: urn:miot-spec-v2:device:vacuum:0000A006:roborock-s5:1
vacuum.status: 3
vacuum.mode: 104
battery.charging_state: 1
state_updater: lan
vacuum.status_desc: Charging
props:
  msg_ver: 3
  msg_seq: 851
  state: 8
  battery: 100
  clean_time: 0
  clean_area: 0
  error_code: 0
  map_present: 1
  in_cleaning: 0
  in_returning: 0
  in_fresh_state: 1
  lab_status: 1
  water_box_status: 0
  fan_power: 104
  dnd_enabled: 0
  map_status: 3
  lock_status: 0
  main_brush_work_time: 68769
  side_brush_work_time: 68769
  filter_work_time: 68769
  filter_element_work_time: 0
  sensor_dirty_time: 68765
  fan_mode: 104
clean_area: 0
clean_time: 0
sub_entities:
  - props:clean_area
  - props:clean_time
  - vacuum-2.status-1
  - battery-3.battery_level-1
  - battery-3.charging_state-2
friendly_name: Roborock
supported_features: 13308

Ok, so it is a nested attribute. Map card do not support them at this moment.

By the way, why do you use custom Miot integration instead of built-in one?
https://www.home-assistant.io/integrations/xiaomi_miio/

That is indeed a good question. I just switched over to the built-in integration and I can now see all the needed attributes without manual configuration. I guess I no longer need the attribute option.

Initially I thought props.main_brush_work_time etc. would be supported like in https://github.com/denysdovhan/vacuum-card.

Thanks.