DeebotUniverse / docs

https://deebot.readthedocs.io
GNU General Public License v3.0
33 stars 9 forks source link

Queue Numbers start at 2 #199

Open GerryCrooked opened 1 year ago

GerryCrooked commented 1 year ago

ok, got the advanced example working 😆 when i add a room to the queue the number is counting up, but it starts with 2. and somehow i can't find why. well maybe someone can help me :)

thanks in advance :)

edenhaus commented 1 year ago

Sorry completely overseen your issue. Does it still exist?

GerryCrooked commented 1 year ago

Hi there, jub still existing :D sorry, i was away last week and i really dont know what im doing different act. as a test i even renamend my Deebot to Susi as well, so i literally copied your code ;-) still starting at Nr. 2

mohamadfarhanmelb commented 1 year ago

hi @GerryCrooked, I have the exact same issue. I managed to copy the code from the Advanced UI and sort out all the icons and stuff, but when I clicked on the rooms (to select which rooms to start cleaning), the number starts with 2 instead of 1. I am trying to figure out why that is such a case but cant find anything..

Running HA 2023.6.1

mohamadfarhanmelb commented 1 year ago

Found it @GerryCrooked ...

  state: >
    {% set room_name = "living_room" %}
    {% set queue = trigger.to_state.state.split(",") %}
    {{ queue.index(room_name)+1 if room_name in queue else 0 }}

you need ti create the above under template: for each room_name I changed mine to this and it worked, started from 1

  state: >
    {% set room_name = "living_room" %}
    {% set queue = trigger.to_state.state.split(",") %}
    {{ queue.index(room_name) if room_name in queue else 0 }}                       #<--- took out the + 1 in this statement
edenhaus commented 1 year ago

@mohamadfarhanmelb Please don't delete the +1 , because it is required

I think both of you have some value (ex. a value from setting up) in the input_text entity. Can you please open the developer tools and verify that your input_text entity is empty (no , or any value), if no room is selected

mohamadfarhanmelb commented 1 year ago

@edenhaus yeah a mistake there.... the array input_text.xxxxxxx already has "unknown" as its first entry. Any new button that I clicked after that will be added on to the list, for example, "nknown,laundry". Any idea what could have caused this?

Also, out of the blye, wondering how can I create a specific queue for multiple area of the same type. For example...

rooms: bedroom:

I have classified 2 area as of type bedroom in my Ecovacs app. How do I create a qeuue specficially for bedroom1 and bedroom13?

edenhaus commented 1 year ago

Use the developer tools to set the input_text entity to an empty state (in other words to delete/clear the state). Afterwards the count should start with 1

I have classified 2 area as of type bedroom in my Ecovacs app. How do I create a qeuue specficially for bedroom1 and bedroom13?

This is not possible with the current example, but you can extend it to support this functionality. Feel free to open a PR to update the example