I know you can load content in html with a target tag to a Iframe.
Can you do the same with a grid?
I would like to stay in 1 dashboard but load my content like my curtains, lamps etc in the content grid when push the button in the left menu bar.
Now i need to copy my code 5 times because the header, menu and footer are all the same for all sections.
Is only the content grid that change
Give this card a try, it can do exactly what you want. And much more, eg. you can animate the transformation from different content cards. It’s really cool.
Thx this looks exactly what i looking for.
But… i’m very new to HA and try to figure out how this works but i struggle with it.
From the example they start with 1 entity dropdown that has 3 states.
So based on the state that is selected the grid show the correspondent entity’s
But how can i make this works with separate buttons like i have?
It sounds complicated, but once you get the idea, it will work quite nicely.
In theory you have to do a few things:
setup an input_select with a name for each view you want to display in the grid. In your case “lichten”, “rolluiken” and so on.
Then in your dashboard set a state-switch-card as the only card in your content area
Fill the state-switch-card with other cards (=your content)
set a tap_action to your button and change the menu entry of the input_select to the content area
Like this:
# this is the input_select
input_select:
frontend_grid_content:
name: Frontend Grid Content
options:
- lichten
- rolluiken
- ...
initial: lichten
# this is the card for your content area
- type: custom:state-switch
view_layout:
grid-area: <your_content_area_name_here>
entity: input_select.frontend_grid_content
default: lichten
transition: slide-down
transition_time: 600
states:
lichten:
type: ... # refer to the state-switch-card documentation, this is where your content goes
rolluiken:
type: ...
# this is the tap_action for your button
tap_action:
action: call-service
service: input_select.select_option
target:
entity_id: input_select.frontend_grid_content
data:
option: lichten # chnage to the specific name eg. rolluiken
Whenever you now change the input_select to a new value, the grid content changes.