PiotrMachowski / lovelace-xiaomi-vacuum-map-card

This card provides a user-friendly way to fully control map-based vacuums in Home Assistant. Supported brands include Xiaomi (Roborock/Viomi/Dreame/Roidmi/Valetudo/Valetudo RE), Neato, Wyze, Roomba, Ecovacs (and probably more).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'dict' object has no attribute 'actions' when calling service

wqhqq1 opened this issue · comments

commented

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

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/xiaomi_miot/init.py:1908
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 14:45:47 (9 occurrences)
Last logged: 15:00:04

[490369283792] 'dict' object has no attribute 'actions'
[490392397392] 'dict' object has no attribute 'actions'
[490651987280] 'dict' object has no attribute 'actions'
Traceback (most recent call last):
File "/opt/python3/lib/python3.11/site-packages/homeassistant/components/websocket_api/commands.py", line 205, in handle_call_service
await hass.services.async_call(
File "/opt/python3/lib/python3.11/site-packages/homeassistant/core.py", line 1965, in async_call
response_data = await coro
^^^^^^^^^^
File "/opt/python3/lib/python3.11/site-packages/homeassistant/core.py", line 2005, in _execute_service
return await cast(
^^^^^^^^^^^
File "/root/.homeassistant/custom_components/xiaomi_miot/init.py", line 419, in async_service_handler
await getattr(ent, fun)(**params)
File "/root/.homeassistant/custom_components/xiaomi_miot/init.py", line 1954, in async_miot_action
return await self.hass.async_add_executor_job(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/python3/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.homeassistant/custom_components/xiaomi_miot/init.py", line 1908, in miot_action
action = self._miot_service.spec.services.get(siid, {}).actions.get(aiid)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'dict' object has no attribute 'actions'

What version of a card has described problem?

v2.2.2

What was the last working version card?

No response

What vacuum model do you have problems with?

viomi.vacuum.v7

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

Xiaomi MIoT

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

Safari

What version of Home Assistant do you use?

core-2023.7.3

What type of installation are you running?

Home Assistant Core

Card's configuration

type: custom:xiaomi-vacuum-map-card
map_source:
  camera: camera.xiaomi_cloud_map_extractor
calibration_source:
  camera: true
entity: vacuum.viomi_v7_beee_robot_cleaner
vacuum_platform: al-one/hass-xiaomi-miot
title: ''
language: zh
two_finger_pan: true
map_locked: false
map_modes:
  - template: vacuum_clean_segment
    max_selections: 1
    repeats_type: EXTERNAL
    max_repeats: 2
    service_call_schema:
      service: xiaomi_miot.call_action
      service_data:
        entity_id: '[[entity_id]]'
        siid: 4
        aiid: 1
        params:
          - piid: 1
            value: 18
          - piid: 10
            value: '{"selects":[[[[selection_unwrapped]],[[repeats]],3,3,1]]}'
        force_params: true
    predefined_selections:
...

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

No

Additional information

No

This is a problem with Xiaomi Miot integration, not card