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

Long-click/tap to execute as other user #116

Open
jlsjonas opened this issue Apr 28, 2023 · 12 comments
Open

Long-click/tap to execute as other user #116

jlsjonas opened this issue Apr 28, 2023 · 12 comments
Labels
enhancement New feature or request

Comments

@jlsjonas
Copy link
Contributor

Since user_id support has been fixed in Grocy for a while now, it would be great if we could either:

  • (MVP) set a long_action_user_id for lock clicks/taps (perfect solution for couples!)
  • Create a selector/UI to select a different user (we would need to map ids to names in config, or infer & cache it from task metadata) -- nice to have, would only implement if there is enough active interest, as it'll significantly increase complexity
@karwosts
Copy link
Collaborator

I added multi-user handling a couple days ago in #111. It's still in the beta release only, and sorry that I haven't gotten around to updating the documentation yet for it.

@jlsjonas
Copy link
Contributor Author

Thanks, looks like I missed that issue!

Chores/Tasks will be tracked by the user_id that matches the username of the current logged in user.

That would greatly improve the native behavior when logged in via phone/pc/similar; however this wouldn't solve this issue for mounted/permanent devices (that are logged in under a generic HA user, not the one interacting with it), or simply checking off a tasks when going over the list together (on any device)

Let me know if this is something you'd still consider & any suggestions and I'll look into an implementation!

Potential consideration: a long-click/tap might not be as intuitive for everyone (although common enough within the HA ecosystem), an alternative could be a second button (with a configurable color distinction between them).

@Galapagon
Copy link

Galapagon commented Apr 30, 2023

@jlsjonas personally, I've been hoping for an integrated dropdown box that would track for whatever user is currently selected from the dropdown.
I know I could do visibility based on external dropdown, but it just seems too cumbersome.

My plan was to use that on a wall mounted tablet, then eventually assign points to different chores around the house so that cleaning can be a game for my kids.

@jlsjonas
Copy link
Contributor Author

🤔 your idea inspired me to a solution that might work right now (as long as you don't have multiple users operating the dashboard at the same time 😅 ), that would actually work nice for your case too:
Create an input helper grocy_assign_to and create a button (as a top row, f.e.) for every family member that will set the helper to that member's grocy id. You could use the helper's value to change the color (or style) of the matching button as a visual indicator.

That being said, as the solution would not work if 2 users happen to be using the buttons at the same time, a native alternative would be nice indeed. (perhaps similar as described above at the top? It could even optionally serve as a filter that way... 🤔 )

@B4dC4rd
Copy link

B4dC4rd commented May 7, 2023

I'm trying to solve this problem too.

Here's my code, but it unfortunately does not work....I cannot tell why exactiy.

type: custom:grocy-chores-card
entity:

  • sensor.grocy_chores
  • sensor.grocy_tasks
    title: Todo
    filter_user: {% if states('input_select.grocy_user') == 'User 2' %} 2 {% elif states('input_select.grocy_user') == 'User 3' %} 3 {% elif states('input_select.grocy_user') == 'Both of Us' %} 4 {% else %} 1 {% endif %}
    show_quantity: 50
    show_assigned: true
    show_overflow: true
    show_chores_without_due: true
    show_tasks_without_due: true
    use_icons: true
    use_long_date: true
    due_in_days_threshold: 3
    use_24_hours: true
    hide_text_with_no_data: true
    haptic: light

@karwosts
Copy link
Collaborator

karwosts commented May 7, 2023

You cannot put templates in the config fields.

@B4dC4rd
Copy link

B4dC4rd commented May 7, 2023

I had a hunch but was still hoping :-D
Anyway this was just the first step of the puzzle to allow me to have a dynamic filter of the chores/tasks.
I would still have to do something similar for the user_id field.

It would indeed be fantastic to allow to complete a task in the name of another user, especially when one of them is "Both of Us" which we do not have a HASS user for to begin with.

@karwosts
Copy link
Collaborator

karwosts commented May 7, 2023

My suggestion for that would be create one card per user, and use conditional card to choose which one to display based on input_select.grocy_user.

@B4dC4rd
Copy link

B4dC4rd commented May 7, 2023

My suggestion for that would be create one card per user, and use conditional card to choose which one to display based on input_select.grocy_user.

Mmm. didn't think of that, I will give it a try!

@Galapagon
Copy link

My suggestion for that would be create one card per user, and use conditional card to choose which one to display based on input_select.grocy_user.

That's the common cited solution, I was really hoping to have it implemented as part of the card though. I don't like the idea of having to keep track of any changes I might make on four or more sets of only sometimes visible card configurations.

@Galapagon
Copy link

🤔 your idea inspired me to a solution that might work right now (as long as you don't have multiple users operating the dashboard at the same time 😅 ), that would actually work nice for your case too: Create an input helper grocy_assign_to and create a button (as a top row, f.e.) for every family member that will set the helper to that member's grocy id. You could use the helper's value to change the color (or style) of the matching button as a visual indicator.

That being said, as the solution would not work if 2 users happen to be using the buttons at the same time, a native alternative would be nice indeed. (perhaps similar as described above at the top? It could even optionally serve as a filter that way... 🤔 )

I like your button idea! I can't anticipate that two users would be trying to use the device literally at the same time, and my long term plan was to include physical buttons to quick switch between users anyway.

I think it would only "fail" if multiple users were trying to do many quick chores and switching back and forth constantly. My thought was that the chores would have a timeout and reset to default afterwards, which in my case, "Automaton" would get credit.

@karwosts
Copy link
Collaborator

karwosts commented May 9, 2023

My suggestion for that would be create one card per user, and use conditional card to choose which one to display based on input_select.grocy_user.

That's the common cited solution, I was really hoping to have it implemented as part of the card though. I don't like the idea of having to keep track of any changes I might make on four or more sets of only sometimes visible card configurations.

Yeah I get it, and it's certainly valid to wait and see if someone wants to pick up that work. I was just suggesting that in case you hadn't thought of it and needed a band-aid while you're waiting.

@karwosts karwosts added the enhancement New feature or request label Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants