See if laptop is on/off without ping?

Hi community,

I’m building an integration, to switch my power-supply on/off, depending if my laptop is turned on/off.
I was thinking of using the “ping” command ( Ping (ICMP) - Home Assistant ), so I would have a binary sensor, telling me the “state” of the laptop.
However, because this is a company laptop, ping is disabled :frowning: (I work from home, 95% of my time)
(I’m local admin on my PC, but company policy locked all kind of things !)
I tried to install a windows companion app, but this needs to open a port to communicate between the windows PC and HA.
I can install software, but opening ports is blocked.
(I can access file-shares on my NAS, install my local printers, do whatever I want on the internet …)

Anyone got a “workaround” for this ? The only thing I want is to let HA see if my laptop is on/off.
I can program a bit in VB.NET, if needed …

Best regards from Belgium,
Kris

This one works on my work computer
GamerClassN7/HA_Desktop_Companion: App which is using native HA Api to comunicate and report data to HA (github.com)

I believe I use the version form late august

edit I just tested the latest version and that works too.

Thanks, but already tested this version, it doesn’t work on my company laptop, due to some ports that are blocked.
In the meantime, I found “IOT Link”, this one seems to work, I see messages coming in on MQTT !
However, only one entitity does work, the one that shows online/offline.
(power status and battery remaining-percent are “unknown”)

Maybe someone can figure out what is wrong ?

configuration.yaml part:

mqtt:  
  binary_sensor:
    - name: "company_laptop_online"
      state_topic: "iotlink/eame/be07631/lwt"
      value_template: "{{ value }}"
      payload_on: "ON"
      payload_off: "OFF"
      device_class: "connectivity"
      qos: 1

    - name: "company_laptop_opladen"
      state_topic: "iotlink/eame/be07631/windows-monitor/stats/power/status"
      value_template: "{{ value }}"
      payload_on: "True"
      payload_off: "False"
      device_class: "plug"
      qos: 1

    - name: "company_laptop_batterij_status"
      state_topic: "iotlink/eame/be07631/windows-monitor/stats/battery/remaining-percent"
      value_template: "{{ value }}"
      device_class: "plug"
      qos: 1!

MQTT:
Capture