DeebotUniverse / Deebot-4-Home-Assistant

Home Assistant integration for deebot vacuums
https://deebot.readthedocs.io/integrations/home-assistant/
GNU General Public License v3.0
180 stars 39 forks source link

how to add multiple rooms with the same name #413

Closed modparts closed 9 months ago

modparts commented 1 year ago

Checks

The problem

I have multiple bathrooms like this:

Rooms

dining_room: 0
bathroom:
  - 8
  - 7
  - 3
kitchen: 4
study: 2
living_room: 5

what do i put here to make it bathroom 8?

unique_id: deebot_robot_queue

Add for each room the following. Change room_name accordingly

- unique_id: deebot_robot_queue_dining_room
  name: deebot_stoffy_queue_bathroom
  # room_name must match the room name provided by the vacuum
  state: >
    {% set room_name = "bathroom" %}
    {% set queue = trigger.to_state.state.split(",") %}
    {{ queue.index(room_name)+1 if room_name in queue else 0 }}

Diagnostics information

none

Anything in the logs that might be useful for us?

No response

Additional information

No response

edenhaus commented 1 year ago

The advanced example cannot distinguish between rooms of the same category. You can adjust it to directly pass the id instead of the name

modparts commented 1 year ago

The advanced example cannot distinguish between rooms of the same category. You can adjust it to directly pass the id instead of the name

Where do i find the id or is it just the number?

edenhaus commented 1 year ago

The vacuum entity has the attribute rooms. This dictionary has the room name as key and the id as value.

For example, in your case, the living room has the id 5.

dunkelheim commented 9 months ago

@edenhaus is there an example for this. I don't get trough what key and value means for the code. To not post a new issue.: I got to this issue because I have two bathrooms and three corridors which I wanted to be my problem solver. Whenever I choose one of these two to be cleaned, deboot changed one of the rooms to clean to the loundry (id 0)

edenhaus commented 9 months ago

The advanced example is the dashboard I use. As I don't have rooms of the same type, I didn't extend the example to work with them. Feel free to open a PR to add support for it. As far as I know, there is no example for it