0

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

Arnau
  • 1
  • 3

2 Answers2

0

Yes.

- cards:
  type: 'custom:floorplan-card'
    - config:
        image: /local/floorplan/examples/simple/simple.svg?v=1.1.14
        log_level: error
        rules:
          - element: floorplan.some_button
            action:
              service: floorplan.page_navigate
              data:
                page_id: tab_name
Limych
  • 121
  • 4
  • Hi! First, thanks for your answer :) . I have been trying it, but it does not work. I have been taking a look into the floorplan.js file and I have realized that apart from **rules** I also need to define **pages**. However, it seems that it only works if we use **multiple pages** inside the same svg. So, I mean, we cannot use floorplane for switching between tabs, but we can switch between different pages which belong to the same SVG. If it is right, please can you give me an example of how it works? Thanks in advance! If it is not, please can you tell me what do you mean by "tab_name"? – Arnau Jan 15 '20 at 00:08
0

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!

Arnau
  • 1
  • 3