Right now, when I tap the room, the lights toggle. When I tap a room’s sensor (green circles), it navigates to a different page of the dashboard showing the sensor plots. When I tap a room’s TV (red shape), it navigates to a different page of the dashboard showing the TV’s remote. And when I tap a room’s camera (blue rectangle), it navigates to a different page of the dashboard showing the camera feed.
I want to tap on a room and either toggle the lights (ha action), or view its sensors (navigate to different page) or view its cameras (navigate to different page) or control its TVs (navigate to different page), depending on the state selected in the bottom-right. The state selector I managed to make using helper variables centrally in home assistant. But to make the tap action work I need to retrieve the action from a function (I guess) which I am trying to find out how to do (unsuccessfully). I cannot even manage to have a floorplan function called from the “action” part of the rule. For some reason the function is not called.
To simplify this, you’re trying to execute the ha-floorplan service functions, but state-dependent?
Where if there information stored about “what action to use”? Do you update a entity in Home Assistant, or locally in your browser? Or are you simply toggle a element within the SVG, and are trying to use that as the “selector parameter”?
Without having the eyes directly in the code, I could see the “execute” solution to be extended; but the hard part could be to secure the relation between a tap-press and the related element.
You’re searching for something like this, right?
Tapping the svg element
Now using the execute
Allow the execute function to trigger ha-floorplan logics like more-info
Also, could I ask you to submit a feature request and include your requirements there? I’ll not promise anything, but It’s nice to have it submitted as a feature request and have the discussion there, too .
This is a very, very good solution if I can run services like homeassistant.toggle and actions like navigate within execute. Do you think this is possible? If yes, then I can definitely handle it (and anything else I can think of) this way. Thank you!
I came late here. There is a simple solution to this problem without any execute function trick but using simple svg layers.
one layer by state of the selector
within each layer, create for each room a transparent room shape with device references
when you select a new selector state, make all layers hidden and the selected one visible.
Like this you exposed to user selected kind of actions directly on the floorplan simply by displaying the corresponding layer.