Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/leonlatsch/pc2mqtt
Small go program to control and monitor your PC with MQTT
https://github.com/leonlatsch/pc2mqtt
go golang homeassistant homeassistant-integration mqtt
Last synced: 3 months ago
JSON representation
Small go program to control and monitor your PC with MQTT
- Host: GitHub
- URL: https://github.com/leonlatsch/pc2mqtt
- Owner: leonlatsch
- License: apache-2.0
- Created: 2024-06-10T09:41:18.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2024-09-16T18:31:30.000Z (4 months ago)
- Last Synced: 2024-09-29T18:54:22.309Z (3 months ago)
- Topics: go, golang, homeassistant, homeassistant-integration, mqtt
- Language: Go
- Homepage:
- Size: 7.26 MB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pc2mqtt
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](.github/images/homeassistant.png)
## 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 the [windows-service-wrapper](https://github.com/winsw/winsw).
1. Download the latest windows zip archive from the releases
2. Unzip it to a directory of your choice
3. In cmd run `pc2mqtt.exe install` and `pc2mqtt.exe start` to install and start it as a windows serviceExplaination: `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 the [windows-service-wrapper](https://github.com/winsw/winsw).
## Config
When first starting the application, a `config.json` will be created right next to it. It looks like this:
```json
{
"device_id": "63fbeebb-f107-4903-ab36-6104b9d802b0",
"device_name": "MY-PC-HOSTNAME",
"mqtt": {
"host": "",
"port": 1883,
"username": "",
"password": "",
"auto_discovery_prefix": "homeassistant"
},
"debug_mode": false
}
```### Parameter descriptions
| Parameter | Description | Default Value |
|-----------------------------|--------------------------------------------------------------------------|----------------------------------|
| `device_id` | A generated id to identify your device. | Generated. Can be changed |
| `device_name` | How your device will be named in eg. homeassistant. | Defaults to hostname |
| `mqtt.host` | Your MQTT hostname eg. 192.168.0.10. | |
| `mqtt.port` | Your MQTT port. | 1883 |
| `mqtt.username` | Your MQTT username. | |
| `mqtt.password` | Your MQTT password. | |
| `mqtt.auto_discovery_prefix`| The prefix used for the auto discovery messages. | `homeassistant` |
| `debug_mode` | Enabled debug mode. Prints more logs and adds a "test" button. |false |