As I understand it, Windows does not natively perform any on/off/wake/sleep network broadcasts. Is there an existing application or service that adds this capability that Sense can take advantage of? Would such a thing be useful for Sense?
If it would be useful and does not already exist, I’d like to take a stab at building it. What does Sense need to see broadcast for the on/off/wake/sleep events?
I am hoping to get some feedback from the Sense team here. I’m a software engineer, so I was thinking that if this doesn’t exist already, I could write an application that would do the job, open-source it, and let the Sense community use it.
An API to interface with would be even better from my perspective, if such a thing existed. I suspect that it does not, and adding one to the Sense just to support detecting on/off/sleep/wake events for PCs would not be worth the Sense team’s time and effort. Taking advantage of something the Sense monitor already does, though, might be.
If your PC is capable of calculating its own power utilization on a regular basis, you could write a “reporter” that emulates how Kasa smartplugs report in on power usage after they receive a “emeter” network broadcast. Somebody has already written an open source SenseLink that reports power from Home Assistant.
Yes, the reporting protocol / API is a small piece of the Kasa query / response protocol that Sense has implemented to “sample” Kasa power monitoring smartplugs.
Here’s some info on the protocol.
I think Sense has only implemented the:
Get Realtime Current and Voltage Reading
command, so one needs to write a “reporter” that listens for and responds to this request. There are several examples of how to do this out on GitHub, that also show how to implement the lightweight encryption that goes with the protocol, including the SenseLink project I posted earlier. There’s also an interesting one here that that shows how to poll data from a Kasa plug, as well as a Sense, using Java.