but i was hoping to try and combine these buttons into 1 button that display changes depending on the computer state is on/off. ie if the pc is off it will show on the on button to allow me to press it to turn on and if its on it will show the off button so that i can turn it off
do you have an entity that reflects the state of the computer? your two switches are momentary? (ie, they are pushbutton and donāt retain the on/off state?)
to do this, youāll need something that maintains on/off state.
if you donāt already have an existing entity for that , then you could create an input_boolean that toggles and when it turns on/off you call the appropriate switch (create a simple automation for that).
once you have that, you can easily assign it to one of many cards that will toggle state.
it all starts w/ having something that keeps state. have one already?
I think you are using a automation and script to add an action to the dashboard buttons?
On = Wake on LAN
Off = script to call windows shutdown
Does Home Assitant know the live status of your PC (On or Off)?
If not, I suggest to use a ping tool in Home Assistant to check the online status of your PC and build an automation based on the ping result to automate the button actions on your dashboard buttons.
huhā¦ so you have a swtich that reflects stateā¦ if thatās the case ā¦ ignoring how nice it looks does this work as a single button for you (use this in your lovelace dashboard card
but first make sure that your switch.PC does actually reflect state.
turn the pc on (not using HA) and see if switch.PC is on.
turn the pc off (not using HA) and see if switch.PC is off.
try this also looking at your switch.Dean-PC (that entity exists for you right?)
2/3 - no i donāt have a entity called cover.pc
it was more or less a guess on what i needed to put in from the template switch page. but i didnāt think it was correct.
4 - the only entities on my HA i have for my pc is switch.dean-pc & the hass agent switch to turn it off switch.switch.dean_pc_dean_pc_shutdown and the only yaml i have in my config file is what i have in 1.
i try your suggestions but it wouldnāt work. so i thought of a different way to fix the issue, using css instead to hide/show the buttons from the state of my pc.