EDIT:
I want to click on an element in the SVG file for one floorplan in a dashboard view ( in my case an image but it could be a path) and have it navigate to another view in the same dashboard. This will allow me to have a single card and single SVG file per floor.
I’ve searched for every option and combination I can think of but can’t get any of them to work.
My SVG files are larger and I have several floors to deal with so I don’t want to combine them.
The most promising was this with floorplan.execute and browser_mod but it doesn’t do anything when clicking on the entity. I get a THIS not defined in the console so it looks like difficulty addressing the local browser.
- entity: switch.kitchen_automation
element: stairs.downstairs
tap_action:
- service: floorplan.execute
service_data:
my_custom_exec_calling_browser_mod: |
>
try{
// Call browser_mod service
browser_mod.service('navigate',{navigation_path: "/lovelace/bottom-floor", browser_id: THIS})
}catch(e){
console.log("Well.. That didn't go as planned",e);
}
'''
That will work in an picture elements card and other places but not when clicking on an element in the ha-floorplan card. I’ve tried a similar approach but I don’t think the navigate action is supported in the ha-floorplan card?
I confirmed it does work as posted by OzGav in floorplan (with the element addition required by floorplan).
Following the usage examples I tried it explicitly with the call-service action and couldn’t get it working - so I wrote off the navigate action. I’m not even sure that their is a homeassistant.navigate service (or at least don’t see it in Developer Tools) so probably down the wrong path.
The Usage examples mention navigate right next to toggle so I assumed they could be called the same way:
When an action trigger is executed, Floorplan can perform any of the available Lovelace actions (call-service, more-info, toggle, navigate, etc.). Floorplan expands on the call-service action, allowing it to run both Home Assistant and Floorplan services.
For ha-floorplan, please use our own Discussion area:
I’m aware of you already have a post at the right place, too. So this is for people finding this tread by searching here or by a search engine like Google.