Several utilities for parent control over MQTT:
- Shutdown computer when use in non-allowed time
- Shutdown computer manually if needed
- Check for running of exact process
- Get CPU Usage
- Get currently used WiFi network
- Get currenly active window
- Get all open windows
- See when computer is online
Windows and Linux supported.
You need Node.JS 18 installed on your computer.
- Clone repo
- Copy
config/sample.json
toconfig/runtime.json
- Edit values in
runtime.json
- Run
npm run build
- Test it with
npm start
Then, for Linux:
- Add it to cron, like
node ./build/index.js
and run it every minute
For Windows:
- Add to task scheduler
run-hidden.exe
from repo root (you can compile it manually from here if you don't trust this exe file) with params likenode build\index.js
and run it every minute after user login via this user's account.Exe
file is required to run node.js in background.
You can use any MQTT integration, but in case you use Home Assistant you can can use following instructions:
Add MQTT devices:
switch:
- platform: mqtt
unique_id: pc_delay
name: "vasya pc delay"
command_topic: "home/vasya/pc/delay"
payload_on: 1
payload_off: 0
retain: true
- platform: mqtt
unique_id: pc_off
name: "vasya pc forceOff"
command_topic: "home/vasya/pc/forceoff"
payload_on: 1
payload_off: 0
retain: true
binary_sensor:
- platform: mqtt
unique_id: vasya-mimimi
name: "vasya mimimi"
state_topic: "home/vasya/pc/online"
payload_on: "1"
device_class: "running"
qos: 0
expire_after: 120
sensor:
- platform: mqtt
unique_id: vasya-pc-window-active
name: "vasya pc window active"
state_topic: "home/vasya/pc/window/active"
qos: 0
expire_after: 120
- platform: mqtt
unique_id: vasya-pc-window-all
name: "vasya pc window all pc"
state_topic: "home/vasya/pc/window/all"
qos: 0
expire_after: 120
- platform: mqtt
unique_id: vasya-pc-wifi
name: "vasya pc wifi"
state_topic: "home/vasya/pc/net"
qos: 0
expire_after: 120
- platform: mqtt
unique_id: vasya-pc-cpu
name: "vasya pc cpu"
state_topic: "home/vasya/pc/cpu"
unit_of_measurement: '%'
qos: 0
expire_after: 120
Finally, enjoy :)