Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Small go program to control and monitor your PC with MQTT

License

NotificationsYou must be signed in to change notification settings

leonlatsch/pc2mqtt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Control your PC or homeserver with homeassistant or any other MQTT enabled home automation system.

Usage

pc2mqtt run on your pc or homeserver and exposes its state and actions via MQTT.

Exposed MQTT Components

  • Power sensor
  • Shutdown button
  • Reboot button

homeassistant

Getting Started / Installation

Installation of pc2mqtt works a little different on windows vs linux.

Linux

  1. Download the latest binary from the releases
  2. Setup a systemd service running the binary on start
  3. Thats it

Windows

For windows pc2mqtt uses thewindows-service-wrapper.

  1. Download the latest windows zip archive from the releases
  2. Unzip it to a directory of your choice
  3. In cmd runpc2mqtt.exe install andpc2mqtt.exe start to install and start it as a windows service

Explaination:wrapped.exe is the actual binary. pc2mqtt.exe is the windows service wrapper which installs the service using the xml config file. For more info have a look at thewindows-service-wrapper.

Config

When first starting the application, aconfig.json will be created right next to it. It looks like this:

{"device_id":"63fbeebb-f107-4903-ab36-6104b9d802b0","device_name":"MY-PC-HOSTNAME","mqtt": {"host":"<YOUR MQTT HOST>","port":1883,"username":"<MQTT USER>","password":"<MQTT PASSWORD>","auto_discovery_prefix":"homeassistant"    },"debug_mode":false}

Parameter descriptions

ParameterDescriptionDefault Value
device_idA generated id to identify your device.Generated. Can be changed
device_nameHow your device will be named in eg. homeassistant.Defaults to hostname
mqtt.hostYour MQTT hostname eg. 192.168.0.10.
mqtt.portYour MQTT port.1883
mqtt.usernameYour MQTT username.
mqtt.passwordYour MQTT password.
mqtt.auto_discovery_prefixThe prefix used for the auto discovery messages.homeassistant
debug_modeEnabled debug mode. Prints more logs and adds a "test" button.false

[8]ページ先頭

©2009-2025 Movatter.jp