Binary Sensor, updates via HTTP, and APC / PowerChute

I have a Windows machine, running VirtualBox, and the container version of HA in an Ubunutu virtual machine.

I just want to make a generic Power On/Off switch, with a default state of on, but tied to NO entity or anything. I want to POST to it when I know the power status, otherwise it stays as ON.

I was thinking just a binary sensor, no entities, platform being template, with just defaulting to ON?

I will use Windows Events and PowerShell to call the HA API to update the status, that part should be easy.

Thoughts?

Well that’s not a switch it’s a sensor. The hint is in the name - binary_sensor. :slight_smile:

What do you want the sensor to display?

Obviously not the Windows host power state as the VM will go up and down with that. If you just want HA to know when some other process is running, I see no problem with what you propose. Though rather than using a template binary sensor you could use this: