Node server to control your screens (linux). Can be used in conjunction with the home-assistant REST switch integration
- pm2 : run the script as a daemon
- The program must run as the current user logged into the current X Session
sudo npm i -g pm2
git clone https://github.com/mj-sakellaropoulos/node-monitor-control-linux ~/nmcl
cd nmcl
bash ./deploy.pm2.bash
To change the default username and password, modify the contents of opts.txt
pm2 logs nmcl
configuration.yaml
- Replace all relevent values in <> brackets.
- You must replace the value of the Authorization header with a base64 encoded string of "username:password"
...
switch:
- platform: rest
name: 'screens'
resource: 'https://<hostname>:<port>/dpms'
body_on: '{"monitor":"on"}'
body_off: '{"monitor":"off"}'
headers:
Authorization: 'Basic <BASE64: username:password>'
Content-Type: application/json
verify_ssl: false
...
Recommended IDE : VSCode
npm run build
node ./build/main/index.js
node index.js port username password