You can make it even easier, if you configure an input_select to be the source of your state switches. Take eg. a navigation. Your entries would be āhomeā, āaboutā, ācontactā.
Now setup an automation that has a state trigger, that reacts on changing the input_select. When you are on āhomeā and you change the input_select, the automation triggers and resets the state back to āhomeā after X seconds.
This is not enough information to go on. What do you have configured in your dashboard? Please post the YAML code of the dashboard (or at least the state-switch-card part) as well as what you have in your automation.
thx itās worked like i want to
I need to learn allot of this code.
What do i need to search on google to find more examples to learn this code?
Just yaml code or is this another syntax
Any way this worked for me now
alias: test return
description: ""
trigger:
- platform: state
entity_id:
- input_select.frontend_grid_content
from: null
to: null
action:
- delay: "00:00:10"
- service: input_select.select_option
target:
entity_id: input_select.frontend_grid_content
data:
option: home
mode: single
Searching for code examples via Google is mostly not very straightforward, Iād use this very forum, the forum search is quite good. As topics tend to get long very quickly, the search can be restricted inside one topic, that works nice as well.
Honestly, HA has a steep learning curve, and the best way I know, is to read in this forum.
For the technical terms, you need the HA documentation and Jinja as the template language. You can find links to both docus on your ādeveloper toolsā page in your HA installation. Which btw. is as well a great resource, that youāll need very often.
And last but not least, this forum is an open place, just ask!
Iām sorry but your instructions and installation procedures are unnecessarily complicated for the average user. Please sort it out as this is what gives Home Assistant a baD REP
Making creative/smart use of this Switch State card by utaliing āspaceā of other cards.
All props to the creator of this card.
My goal is to have a single-page dashboard. I have been playing around alot with different setups and came across this card.
In my example : Spotify/Sonos does have a prominent space in the dashboard.
Not without reason, because we listen alot to music.
With the switch card I can now temporaly āborrowā the space for our thermostate controls and for audio settings of Sonos.
With some automations it will switch back after X seconds/minutes to the media player.
Curious problem using state-switchā¦ (Thanks for an excellent card otherwise! ) When using the visual editor the content of the state-switch is displayed on-top of the editor, blocking part of the view. Isolated the problem to implicate state-switch using this simple example in its own dashboard. (The Apexchart on its own works as it should.) Fully updated installation. Grateful for any suggestions?
having an issue when using this state-switch config:
when on mobile phone, the āallā is chosen, and then my view is somehow overflowing the displayās width, and unstable horizontally.
Ive had that issue before on other card, and it turned out a tooltip option was indeed set too wide, or a margin mod.
however, in the decluttering templates used in this config, not a single mod is set, so all should default to HA dashboard settings.
Moreover, if I only uses the āallā section, and take out the state-switch completely, the issue does not arise.
Making this somehow related to the state-switch card perse.
Would anyone know if there are margins used inside the resource we can card_mod down again?
Ive also tried to write the āallā section verbosely to rule out the decluttering-card, and that has no effect. Leaving the state-switch to cause some margin issues somewhereā¦
feels but clunky to have to repeat the conditional, and not be able to set an if/else, like with state-switch, but the fact it remains within the boundaries of the view, and does not cause the view to slide to and fro makes this the preferred config now.
I am trying to get a card to show depending on the device. I installed the BrowserMod and have both my pc and phone registered and I get the popup test to work.
With the state-switch Iām not getting the code to recognize the deviceID and it only shows the default. Can anyone help me identify the issue? Iām fairly new to HA.
Thank you in advance for any pointers.
This is the code Iām using for tests:
type: custom:state-switch
entity: deviceID
default: default
states:
4563356-c4edgfsd:
type: markdown
content: |
## This is my PC
3456345f-3456434:
type: markdown
content: |
## This is the phone app
default:
type: markdown
content: |
## Unknown Device
Hello everyone,
I have a card that displays the ink levels of my printer.
When the printer is turned off, the ink level sensors are not available.
So I would like to hide the card when the printer is turned off and only show it when the EPSON printer sensor is in one of the three following states: idle, printing, stoppedā¦
I started like this:
But I would like to avoid rewriting the same code three times for the three states dle, printing, stopped
How can I solve this?
Is there a possibility to check all three states only in one condition?
Thanks
I also tried with the conditional card but itās not a good solution because when the printer is turned off the EPSON sensor becomes unavailableā¦
So I canāt play on its states
Thanks