Search code examples
home-assistant

Does lovelace-floorplan allow to navigate through the Home Assistant tabs?


I would like to know if lovelace-floorplan can be used for navigating through the Home Assistant tabs, like picture-elements does. If this is the case, could you provide some yaml example for configuring this feature?

As far as I know, inkscape can be used for adding links into a SVG file. Even though it achieves my goal, the problem is that not only the tab, but the entire home assistant is reloaded (waste of time and resources).


Solution

  • I have found a solution checking the floorplan.js code. The following piece of code is able to paginate between 3 different svg files which are defined in the same tab.

    This is the code:

    title: Floor Plan Test
    type: 'custom:floorplan-card'
    config:
      log_level: info
      pages:
        - image: /local/test1.svg?v=1.1.15
          log_level: info
          page_id: page1
          rules:
            - element: button_1a
              action:
                service: floorplan.page_navigate
                data:
                  page_id: page3
            - element: button_2a
              action:
                service: floorplan.page_navigate
                data:
                  page_id: page2
          stylesheet: /local/style.css?v=1.1.14
        - image: /local/test2.svg?v=1.1.15
          log_level: info
          page_id: page2
          rules:
            - element: button_2a
              action:
                service: floorplan.page_navigate
                data:
                  page_id: page3
          stylesheet: /local/style.css?v=1.1.14
        - image: /local/test3.svg?v=1.1.15
          log_level: info
          page_id: page3
          stylesheet:/local/style.css?v=1.1.14
          master_page: 
            content_element: floorplan
          rules:
            - element: button_3a
              action:
                service: floorplan.page_navigate
                data:
                  page_id: page1
    

    I'll appreciate any comment, thanks!