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

[Feature Request] Way to directly choose value of input_select #537

Closed
esdcmc opened this issue Oct 24, 2022 · 15 comments
Closed

[Feature Request] Way to directly choose value of input_select #537

esdcmc opened this issue Oct 24, 2022 · 15 comments
Assignees
Labels
appdaemon releated to HA AppDaemon App enhancement New feature or request hmi Task is releated to HMI Project
Milestone

Comments

@esdcmc
Copy link

esdcmc commented Oct 24, 2022

FEATURE DESCRIPTION

It would be nice if input_select entities featured up and down arrows to move selection in both directions and also on GridCards.

ADDITIONAL CONTEXT

Input_select entities only show the values on entitiesCard (on GridCards I only get an icon) and they only evolve in one direction when tapped (say I have got a,b,c,d to select from, every time I tap ‘a’ goes to ‘b’, then ‘c’, then ‘d’, then ‘a’ again).

PANEL / FIRMWARE VERION

12.2.0.1 (this is the Tasmota firmware), the lovelace-ui version I think is the latest you pushed on home-assistant/appdaemon (3.5.0? how do I check this?)

model: I've got two US-L and one EU

@joBr99
Copy link
Owner

joBr99 commented Oct 24, 2022

I would suggest a popup page allowing to choose the value

image

@esdcmc
Copy link
Author

esdcmc commented Oct 25, 2022

Whatever is easier for you: pop-up would certainly do.

it would be nice though that the selected value showed on cardGrid instead of the icon (at least the initial character or in case of a number selection, the number should show, similar to what the sensor entities do).

For CardGrids I thought to something similar to the temp field in the climate card which has got arrows pointing up and down.
For CardEntities maybe an horizontal line to select (similar to the brightness for lamps).

But, again, if pop-up is easier, that would be great.

Thanks a lot for considering all that.

@joBr99 joBr99 added this to the 3.6.X milestone Oct 25, 2022
@joBr99
Copy link
Owner

joBr99 commented Oct 25, 2022

Checkout latest development version

image

https://docs.nspanel.pky.eu/faq/#how-to-upgrade-from-a-release-to-the-current-development-version


For the Icon, you can assign your values icons or text.

          - entity: light.test_item
            name: NameOverride
            icon:
                "on": mdi:lightbulb
                "off": "text:"

or even display something directly from homeassistant with a template

        icon: 'ha:{{ state_attr("climate.wohnzimmer_boden","current_temperature")}}'

https://docs.nspanel.pky.eu/entities/#override-icons-or-names

@joBr99 joBr99 closed this as completed Oct 25, 2022
@joBr99 joBr99 changed the title driving input_select entities up and down on gridCards [Feature Request] Way to directly choose value of input_select Oct 25, 2022
@joBr99 joBr99 added enhancement New feature or request hmi Task is releated to HMI Project appdaemon releated to HA AppDaemon App labels Oct 25, 2022
@joBr99 joBr99 self-assigned this Oct 25, 2022
@finipini
Copy link

finipini commented Jan 8, 2023

Checkout latest development version

image

https://docs.nspanel.pky.eu/faq/#how-to-upgrade-from-a-release-to-the-current-development-version

For the Icon, you can assign your values icons or text.

          - entity: light.test_item
            name: NameOverride
            icon:
                "on": mdi:lightbulb
                "off": "text:"

or even display something directly from homeassistant with a template

        icon: 'ha:{{ state_attr("climate.wohnzimmer_boden","current_temperature")}}'

https://docs.nspanel.pky.eu/entities/#override-icons-or-names

That is nice indeed for some cases. But that brocken my request a while ago, where single click moved to Next option .

#301 (comment)

Could be a way that que could choose the behaviour of the click? In the case of my request we often only choose the first option , so only one click is way simpler, but sometimes we choose too other options.

@joBr99
Copy link
Owner

joBr99 commented Jan 8, 2023

If you want to select a specific option, you can call the service to select it directly.

https://docs.nspanel.pky.eu/entities/?h=serv#calling-service-directly-as-button

@finipini
Copy link

finipini commented Jan 9, 2023

If you want to select a specific option, you can call the service to select it directly.

https://docs.nspanel.pky.eu/entities/?h=serv#calling-service-directly-as-button

Not a specific option.

        - entity:input_select.aspirar_sala 
            icon:
                "0": sofa
                "1": numeric-1-box
                "2": numeric-2-box
                "3": `numeric-3-box

The previous behaviour with this code was that one click moved to another state and so another icon, now it opens an pop up

This is to choose the number of iterations an robot vaccum do per room.

With your sugestion this

          - entity: service.input_select.select_next
            icon:
                "0": sofa
                "1": numeric-1-box
                "2": numeric-2-box
                "3": numeric-3-box
            data:
              entity_id: input_select.aspirar_sala

doesn,t work all page turns blank. With this:

          - entity: service.input_select.select_next
            icon: table-furniture
            data:
              entity_id: input_select.aspirar_sala

... it works but i don,t know the state of the input-select.

I think i saw somewhere someone suggesting that in input-select the single click could stay has it was and only long_press should open the pop_up.... like it happens with lights.

I really like the behaviour of input_select before this change, that page was very usefull like it was....

@joBr99
Copy link
Owner

joBr99 commented Jan 9, 2023

Can you try to add the status parameter into the entity?

          - entity: service.input_select.select_next
            status: input_select.aspirar_sala
            icon:
                "0": sofa
                "1": numeric-1-box
                "2": numeric-2-box
                "3": numeric-3-box
            data:
              entity_id: input_select.aspirar_sala

@finipini
Copy link

finipini commented Jan 9, 2023

Same behaviour has without status, all page becames blank...

@joBr99
Copy link
Owner

joBr99 commented Jan 9, 2023

Have to test myself and see what the error Message in the log is

@finipini
Copy link

finipini commented Jan 9, 2023

i will try to see that

@finipini
Copy link

finipini commented Jan 9, 2023

 File "/config/appdaemon/apps/nspanel-lovelace-ui/luibackend/pages.py", line 386, in generate_entities_page
    command += self.generate_entities_item(item, cardType, tempUnit)
  File "/config/appdaemon/apps/nspanel-lovelace-ui/luibackend/pages.py", line 241, in generate_entities_item
    icon_id = get_icon("script", overwrite=icon)
  File "/config/appdaemon/apps/nspanel-lovelace-ui/luibackend/icons.py", line 186, in get_icon
    if overwrite_state == state:
NameError: name 'state' is not defined
2023-01-09 17:38:14.084014 WARNING nspanel-1: ------------------------------------------------------------

don,t know if there is somthing about it
The code is between line 159 and 165

@finipini
Copy link

finipini commented Jan 9, 2023

2023-01-09 17:44:30.341423 INFO nspanel-1: Button Press Event; entity_id: screensaver; button_type: bExit; value: 1 
2023-01-09 17:44:30.349709 INFO nspanel-1: Started rendering of page 1 with type cardGrid
2023-01-09 17:44:30.352848 INFO nspanel-1: Sending MQTT Message: pageType~cardGrid
2023-01-09 17:44:30.355792 WARNING nspanel-1: ------------------------------------------------------------
2023-01-09 17:44:30.356499 WARNING nspanel-1: Unexpected error in worker for App nspanel-1:
2023-01-09 17:44:30.356888 WARNING nspanel-1: Worker Ags: {'id': '809feed10f6e4462b7fc6e9fdf6376b7', 'name': 'nspanel-1', 'objectid': '831d4cd1a529419aaf997522e4a33167', 'type': 'event', 'event': 'MQTT_MESSAGE', 'function': <bound method LuiMqttListener.mqtt_event_callback of <luibackend.mqtt.LuiMqttListener object at 0x7efe5e991b70>>, 'data': {'topic': 'tele/nspanel_0CBA34/RESULT', 'wildcard': None, 'payload': '{"CustomRecv":"event,buttonPress2,screensaver,bExit,1"}'}, 'pin_app': True, 'pin_thread': 1, 'kwargs': {'topic': 'tele/nspanel_0CBA34/RESULT', '__thread_id': 'thread-1'}}
2023-01-09 17:44:30.359484 WARNING nspanel-1: ------------------------------------------------------------
2023-01-09 17:44:30.361374 WARNING nspanel-1: Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/appdaemon/threading.py", line 950, in worker
    funcref(args["event"], data, self.AD.events.sanitize_event_kwargs(app, args["kwargs"]))
  File "/config/appdaemon/apps/nspanel-lovelace-ui/luibackend/mqtt.py", line 58, in mqtt_event_callback
    self._controller.button_press(entity_id, btype, value)
  File "/config/appdaemon/apps/nspanel-lovelace-ui/luibackend/controller.py", line 219, in button_press
    self._pages_gen.render_card(self._current_card)
  File "/config/appdaemon/apps/nspanel-lovelace-ui/luibackend/pages.py", line 652, in render_card
    self.generate_entities_page(navigation, card.title, card.entities, card.cardType, temp_unit)
  File "/config/appdaemon/apps/nspanel-lovelace-ui/luibackend/pages.py", line 386, in generate_entities_page
    command += self.generate_entities_item(item, cardType, tempUnit)
  File "/config/appdaemon/apps/nspanel-lovelace-ui/luibackend/pages.py", line 241, in generate_entities_item
    icon_id = get_icon("script", overwrite=icon)
  File "/config/appdaemon/apps/nspanel-lovelace-ui/luibackend/icons.py", line 186, in get_icon
    if overwrite_state == state:
NameError: name 'state' is not defined

or this

@joBr99
Copy link
Owner

joBr99 commented Jan 9, 2023

update to main in hacs, restart appdaemon and try again :)

@finipini
Copy link

finipini commented Jan 9, 2023

update to main in hacs, restart appdaemon and try again :)

Sorry was busy... but yes it works now again, thanks for the effort...

@viDU85
Copy link

viDU85 commented Feb 28, 2023

I would suggest a popup page allowing to choose the value

image

Would it be possible to increase the font size for the values?

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
appdaemon releated to HA AppDaemon App enhancement New feature or request hmi Task is releated to HMI Project
Projects
None yet
Development

No branches or pull requests

4 participants