How to change the look of a switch

I just added a delay to a script that activates my ‘alarm system’ (it’s just one camera lol). The delay was to allow the camera to get into position before motion detection turned on… anyway… after I did the Activate button became a toggle switch, I was wondering if it is possible for me to change it back. (the pic shows what I mean

changing the look of switches in general seems like a useful idea for customisation but I can’t find any info how to do it.

screenshot showing what i mean

I think you can’t. The reason it changed is that it now doesn’t simply fire off a (set of) command(s) anymore. (due to the delay). But it sees it as an action running for a longer period. As soon as your script is activated, it starts running and it stops when your actions are complete (including the delays). You also can’t restart your script while it is still running.
In my opinion the switch should stay “on” for as long as your script is running.

Am I making sence or am I being unclear?

1 Like

I haven’t tried it, but you could probably make another script that calls that script.

1 Like

@Bob_NL Thanks for the reply. ye you made great sense feel a bit silly for not realising it. I just hoped the ability to customise a switch’s appearance was one of those ‘hidden’ features of something.

@Orthodoxmonster Thanks for the suggestion, unfortunately, it doesn’t work, not a big deal but was an interesting idea.

thanks for the suggestions.

In customize add can_cancel: false


@Robban WOW thanks a lot… worked like a treat.

1 Like

This is not working for me(does not change on/off to activate only? I have hass v0.74.

did you clear the cache and reload the page? CTRL+F5

I clear the cache but still not working.

you are using can_cancel: true, correct?

@petro sorry for late answer.

I try boath combination (can_cancel: true and can_cancel: false) but not working?


commandline switch:

  - platform: command_line
        command_on: './config/dcripts/'

in costumize:

   can_cancel: true

Thanks for the “can cancel” tip. Previously i had just had a second script call the first script

can_cancel only works for scripts.
Try assumed_state: true

1 Like