nergal / homeassistant-vacuum-viomi

Integration of a Xiaomi Viomi vacuum to a Home Assistant
MIT License
53 stars 14 forks source link

Add additional attributes for STY02YM #35

Open X1pheR opened 1 year ago

X1pheR commented 1 year ago

I have the global (china) version of the Mi Robot Vacuum-Mop P. On the back it says the model is STYTJ02YM and in the Xiaomi Home app it displays as viomi.vacuum.v7. Firmware is 3.5.3_0047.

With another forked repo which doesn't work (anymore) I had a lot more attributes. Could these be added? Especially the consumables (for support in the lovelace vacuum card) and box_type (for automations notifying of emptying container) are of interest. https://github.com/l-j/home-assistant-vacuum-styj02ym

The full list of attributes I got with the other repo:

fan_speed_list:
  - Silent
  - Standard
  - Medium
  - Turbo
battery_level: 100
battery_icon: mdi:battery-charging-100
fan_speed: Turbo
run_state: 5
mode: 0
err_state: 2105
battary_life: 100
box_type: 1
mop_type: 0
s_time: 0
s_area: 0
suction_grade: 3
water_grade: 12
remember_map: 1
has_map: 1
is_mop: 0
has_newmap: 0
side_brush_life: 98
side_brush_hours: 178
main_brush_life: 88
main_brush_hours: 317
hypa_life: 76
hypa_hours: 137
mop_life: 100
mop_hours: 180
water_percent: 0
hw_info: 1.0.3
sw_info: 3.5.3_0047
start_time: 0
order_time: '0'
v_state: 0
zone_data: '0'
repeat_state: 0
light_state: 1
is_charge: 0
is_work: 1
cur_mapid: 1630292632
mop_route: 0
map_num: 1
main_brush_left: 317
side_brush_left: 178
filter_left: 137
sensor_dirty_left: 180
cleaned_area: 0
cleaning_time: 0
status: docked
friendly_name: Stofzuiger
supported_features: 13180
igorsantos07 commented 1 year ago

This would be awesome, although it seems the repo is abandoned :(

So sad when such cool devices don't have proper support from HA, since the official integration developers also doesn't seem to bother with those scenarios: https://github.com/home-assistant/core/issues/27268#issuecomment-921155610

However, now that I'm paying more attention to your post... I do have consumables statistics. I'm using a heavily configured custom:vacuum-card, check below the full config (sorry for the portuguese names! haha)

custom:vacuum-card
type: custom:vacuum-card
image: /local/photos/vacuum/r2d2-icon.png
map: camera.mapa_do_aspirador
compact_view: false
show_name: false
stats:
  default:
- attribute: main_brush_left
subtitle: Escovão
unit: '%'
value_template: '{{ (value/360*100) | round }}'
- attribute: side_brush_left
unit: '%'
value_template: '{{ (value/180*100) | round }}'
subtitle: Escovinha
- attribute: mop_left
unit: '%'
value_template: '{{ (value/180*100) | round }}'
subtitle: Pano
- attribute: filter_left
unit: '%'
value_template: '{{ (value/180*100) | round }}'
subtitle: Filtro
- subtitle: Pano?
  attribute: mop_attached
value_template: '{{ "Com" if (value) else "N" }}'
cleaning:
  - attribute: cleaned_area
unit: m²
     subtitle: Área limpa
- attribute: cleaning_time
unit: min
subtitle: Tempo limpando
shortcuts:
  - name: Tudo
icon: mdi:home-circle
service: script.aspirar_tudo
- name: Áreas principais (sala/cozinha/escritório/varanda)
icon: mdi:rug
service: script.aspirar_criticos
- name: Sala + Jantar
service: script.aspirar_sala_toda
icon: mdi:sofa
- name: Escritório
icon: mdi:chair-rolling
service: script.aspirar_escritorio
- name: Quarto
icon: mdi:bed-empty
service: script.aspirar_quarto
show_toolbar: true
show_status: true
entity: vacuum.r2d2