maykar / compact-custom-header

This project has been replaced by Custom Header
MIT License
239 stars 31 forks source link

[Feature Request] Change Lovelace Default Tab Based on Entity State #196

Closed shbatm closed 5 years ago

shbatm commented 5 years ago

Is your feature request related to a problem? Please describe. No

Describe the solution you'd like This may exist already, but I'm missing it if it is...

I would like to have an exception/condition based on the current state of an entity. For example, if person.me is home then when I open HA on my phone, the default_tab would be my climate tab, but if I'm away, the default tab would be the security tab. More advanced use case for this would be when I get my room presence detection working better, then I could use an input_select to detect what room I'm in, and when I open HA, jump to that room.

I know I can accomplish some of this with the browser_mod custom component, but that only works if I have the app/page open on my phone already.

maykar commented 5 years ago

This isn't in the current version, but is already in the dev branch to be released soon. It will be used as a javascript template. Example:

cch:
  default_tab_template: >
    if (states["person.me"].state == "home") "climate";
    else if (states["person.me"].state == "away") "security";
shbatm commented 5 years ago

Awesome. I'll switch over to dev and give it a try! Thanks!

maykar commented 5 years ago

Added in the latest release. More info:

https://community.home-assistant.io/t/compact-custom-header/83716/1179