Subview timout - auto close/back

So the new subview feature in Lovelace is great.

It’s really handy for me as I’m using a small Kindle Fire8 as a wall mounted device, but due to it’s small screen, it’s handy to be able to open up a subview to see more details about something.

What would be really useful though, is if a subview could automatically close after a few seconds back to the previous page.

Can anyone think of a hacky way to do this??

I agree a timeout parameter to have the sub view go automatically back to the calling page after a set time would be a nifty feature.

In the meantime, yes - I do this for my wall tablet. If you use Fully Kiosk and browser mod this automation should be able to be modified very easily for your configuration.

Reset Dashboard Automation
- id: hass_kiosk_reset_dashboard
  alias: "[Hass] Kiosk Reset Dashboard"
  description: "Reset dashboard to home page."
  mode: restart
  trigger:
    - platform: state
      id: page
      entity_id: sensor.fire_tablet_current_page
      to: ~
      for: 300

    - platform: state
      id: app
      entity_id: sensor.fire_tablet_foreground_app
      to: ~
      for: 300
  condition:
    - condition: state
      entity_id: binary_sensor.kiosk_online
      state: "on"

    - not:
        - condition: state
          entity_id: sensor.fire_tablet_current_page
          state: http://192.168.1.100:8123/lovelace-kiosk/home
  action:
    - wait_template: >
        {{ is_state('binary_sensor.kiosk_motion','off')
            and is_state('input_boolean.alarm_triggered','off') }}
      timeout: 300

    - if: "{{ trigger.id == 'page' }}"
      then:
        - if: "{{ states('sensor.fire_tablet_current_page')[:26] == 'http://192.168.1.100:8123/' }}"
          then:
            - service: browser_mod.navigate
              data:
                path: /lovelace-kiosk/home
                browser_id: kiosk_internal
          else:
            - service: button.press
              target:
                entity_id: button.fire_tablet_load_start_url
      else:
        - service: button.press
          target:
            entity_id: button.fire_tablet_restart_browser

PS Don’t forget to vote for your own request!

4 Likes

I’ve used sub views quite a lot now and have tablets wall mounted in most rooms. My wife forever leaves the tablets in subviews and I find it really annoying. As it is impossible to train a wife, I really need a technical solution.

1 Like

Vote for the change here: Timeout on subview (new feature ) to return after select period

Hello Jason
I tried this script but is there an updated version of it?

I’m assuming you use Fully Kiosk and Browser Mod? The script should still work, but you have to modify it for your system.

Can you post what you have?

FYI: This achieves what is needed: GitHub - BWilky/viewtimeout: Returns to default view after activity timeout

@Jay_from_NuZiland does not work at all…

Sure it does, it’s working perfectly for me.

If I recall correctly there a dependency that is not mentioned in the main repo but it’s mentioned in a few of the issues. It is a requirement.