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: Show entity state in a widget, like a toggle switch #402

Closed
dshokouhi opened this issue Feb 12, 2020 · 12 comments
Closed
Labels
enhancement New feature or request stale widget

Comments

@dshokouhi
Copy link
Member

Home Assistant Android version:
1.7.0
Android version:
10
Phone model:
Pixel 4 XL
Home Assistant version:
0.105
Last working Home Assistant release (if known):
N/A
Description of problem:

Now that we have awesome widgets it would be great if we had a toggle widget that would reflect the state of any one entity with a on or off state like light switch or input_boolean.

Traceback (if applicable):

N/A

Additional information:
Trying to keep this request small and simple :)

@dshokouhi dshokouhi added enhancement New feature or request widget labels Feb 12, 2020
@balloob
Copy link
Member

balloob commented Feb 12, 2020

Poor battery life.

@dshokouhi
Copy link
Member Author

Yea I imagine we would need to have some sort of events being passed from core to the app to update the state in a friendly way. However with motion activated lights it would definitely kill battery life. My use case was like a input boolean you only turn on and off a few times a day to see the state and quickly toggle it if you need to.

@balloob
Copy link
Member

balloob commented Feb 12, 2020

It's the updating of the state that will ruin the battery life. Because I doubt people want to wait 15 minutes between state updates.

There was someone on Twitter who had this Android quick toggle tile that would open a UI to quickly control stuff. That would be better fitting because we just update the state when you open that ui.

@dshokouhi
Copy link
Member Author

I was actually thinking that maybe we could do something like whats described here for real time and battery friendly: https://www.home-assistant.io/blog/2015/12/10/activating-tasker-tasks-from-home-assistant-using-command-line-switches/

The more I think about this the more complicated it sounds lol

@JBassett
Copy link
Collaborator

Would we be opposed to adding functionality in the mobile_app integration to send a push notification on state change for only states used in toggle type widgets? That way we don't need to poll and we get quick updates?

@robbiet480
Copy link
Member

Would we be opposed to adding functionality in the mobile_app integration to send a push notification on state change for only states used in toggle type widgets? That way we don't need to poll and we get quick updates?

Keep in mind we currently limit users to 150 notifications per 24 hours.

@rigrig
Copy link
Contributor

rigrig commented Aug 28, 2020

Now that we have widgets displaying state anyway, could they be combined with Service Buttons?
(I was about to open a new issue, but it seemed too much of a duplicate of this)

Is your feature request related to a problem? Please describe.
If you want to view an entity and be able to call services, you currently need two widgets:

  • one "Entity State", which does nothing when pressed
  • one "Service Button", which doesn't show useful information

Describe the solution you'd like
I would like to have a single widget that can do both.
Ideally: add optional settings to call a service on press to both "Entity State" and "Template" widgets. (And after performing the service call, update the widget right away.)

Describe alternatives you've considered, if any

  • Adding new "combined" widget types: I don't think there is a need for this, as you can just leave the service settings empty to keep current behaviour.
  • Removing the "Service Button" altogether: I think it would be nice to keep, in case you just want a button which does something.

Additional context
Settings would look something like this:
image image
(Added the checkbox to make clear you don't need to input a service call if you just want to display some state.)

@gohlas
Copy link

gohlas commented Sep 2, 2020

That is a good idea.

Not sure about how would be the development for this.
But before I used to have the Ariela app and they have this Widget functionality with state and toggle the entity.
Personally that is the only thing holding me to go 100% to Home Assistant app. I use it quite a lot.

@dshokouhi
Copy link
Member Author

@rigrig and @gohlas one issue with this is that the state will not be reflected properly at times because the entity state widget checks into HA every 15 minutes or when it is tapped.

How does the widget function in Ariela? Is it ever out of sync with HA?

@rigrig
Copy link
Contributor

rigrig commented Sep 2, 2020

@dshokouhi I realize stale state is still an issue, but the "Entity State" and "Template" widgets are already here, so I just proposed adding service call functionality to them.

About updating though: can Android widgets detect if the screen is on and they are visible?
Because I think just keeping a websocket open while the user is actually looking at the widget wouldn't use up that much battery?

@gohlas
Copy link

gohlas commented Sep 3, 2020

@dshokouhi the sync from Ariela is on the fly. Maybe delay of 2, 3 seconds.
I didn't really notice a big difference of battery usage, but of course there are some.

But this idea of @rigrig using a call service with entity state widget and using the on/off screen, seems to be quite good (as there is the on/off screen sensor on HA).
Or maybe giving the user some more option to choose how often the user wants the update. Then everyone can adjust for its personal desired and needs.

Of course you will now more about the limitations and problems on development. Its just a suggestion.

Let me know if you wish to make some tests on Ariela app.

@stale
Copy link

stale bot commented Dec 25, 2020

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 25, 2020
@stale stale bot closed this as completed Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale widget
Projects
None yet
Development

No branches or pull requests

6 participants