Use a button Toggle between scenes based on plug status

Hi all,
I have setup a couple of scenes imported from my Vera Controller.
HA sees them well and everything is working.
Now I would like to setup a button to activate either of the scenes depending on the status of a plug.
Actually the two scenes are used to power on (and setup ) the hifi audio system and to power it off. Everything is behind a Neo Coolcam plug.
Whenever the button is pressed i want to check the status of the plug and if it is on, then activate the scene to turn it off, otherwise activate the scene to turn it on.

I really have shot expertize with HA configurations…

Thanx in advance.

Do you have a HA entity that shows the state of the plug? If so, then you should probably look at the Template Switch. You can use the state of the switch in the value_template parameter, and then invoke the scenes via the turn_on and turn_off parameters. I haven’t tried this, but it sounds like just what you need. Let me know if you have any questions.

Thank you for your reply.
I can read the plug status. At the end I found a quick’n’dirty solution.
I made 2 automations triggered by the button, with a condition based on the plug status.
To activate the scene I just call a service scene.turn_on