Android: Feature Request: Show entity state in a widget, like a toggle switch

Created on 12 Feb 2020  路  12Comments  路  Source: home-assistant/android

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 :)

enhancement stale widget

Most helpful comment

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.

All 12 comments

Poor battery life.

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.

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.

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

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?

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.

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.)

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.

@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?

@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?

@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.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AndrewDaws picture AndrewDaws  路  4Comments

andriej picture andriej  路  4Comments

ofalvai picture ofalvai  路  5Comments

aleksandrov1995 picture aleksandrov1995  路  4Comments

Anonym-tsk picture Anonym-tsk  路  3Comments