mvuille
(Martin Vuille)
1
I added a restart switch to my YAML:
switch:
- platform: restart
id: restart_switch_id
restore_mode: ALWAYS_OFF
name: "Restart XXXX"
For some reason, it is getting represented in the Home Assistant GUI as (I guess) a power switch:

What do I have to add to my YAML to make it into a two-position control like other switches?

Edit: Home Assistant Core version is 2024.9.1, Frontend version 20240906.0
tom_l
2
It has an assumed state. There is no state feedback.
Press the lightning icon once and it should turn into a toggle switch as HA can now optimistically assume the state.
I prefer using the restart button instead.
If you stick with the switch you can remove this line as it is the default restore state:
restore_mode: ALWAYS_OFF
mvuille
(Martin Vuille)
3
Thank you! The restart button is the exact solution I didn’t know I was looking for.