Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Queue Numbers start at 2 #199

Open
GerryCrooked opened this issue Jan 5, 2023 · 7 comments
Open

Queue Numbers start at 2 #199

GerryCrooked opened this issue Jan 5, 2023 · 7 comments

Comments

@GerryCrooked
Copy link

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
Copy link
Contributor

Sorry completely overseen your issue. Does it still exist?

@GerryCrooked
Copy link
Author

GerryCrooked commented Jun 1, 2023

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
Copy link

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
Copy link

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
Copy link
Contributor

edenhaus commented Jun 11, 2023

@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
Copy link

mohamadfarhanmelb commented Jun 11, 2023

@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:
- 1
- 13

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

  • unique_id: deebot_dobby_queue_bedroom1
    name: deebot_dobby_queue_bedroom1
    state: >
    {% set room_name = "bedroom" %} <---- what do I put the room_name as for bedroom1
    {% set queue = trigger.to_state.state.split(",") %}
    {{ queue.index(room_name)+1 if room_name in queue else 0 }}
  • unique_id: deebot_dobby_queue_bedroom13
    name: deebot_dobby_queue_bedroom13
    state: >
    {% set room_name = "bedroom" %} <---- what do I put the room_name as for bedroom13
    {% set queue = trigger.to_state.state.split(",") %}
    {{ queue.index(room_name)+1 if room_name in queue else 0 }}

@edenhaus
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants