{"id":21475239,"url":"https://github.com/pfichtner/mqtt-machine-state","last_synced_at":"2026-05-18T22:13:21.348Z","repository":{"id":212097051,"uuid":"730703457","full_name":"pfichtner/mqtt-machine-state","owner":"pfichtner","description":"Send messages to mqtt broker on machine startups/shutdowns","archived":false,"fork":false,"pushed_at":"2023-12-19T10:05:39.000Z","size":94,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-12-19T15:59:39.673Z","etag":null,"topics":["automation","mqtt"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pfichtner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-12-12T13:48:54.000Z","updated_at":"2023-12-20T21:39:48.638Z","dependencies_parsed_at":"2023-12-20T21:50:08.972Z","dependency_job_id":null,"html_url":"https://github.com/pfichtner/mqtt-machine-state","commit_stats":null,"previous_names":["pfichtner/mqtt-machine-state"],"tags_count":4,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfichtner%2Fmqtt-machine-state","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfichtner%2Fmqtt-machine-state/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfichtner%2Fmqtt-machine-state/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pfichtner%2Fmqtt-machine-state/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pfichtner","download_url":"https://codeload.github.com/pfichtner/mqtt-machine-state/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243997038,"owners_count":20380980,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","mqtt"],"created_at":"2024-11-23T10:39:26.332Z","updated_at":"2026-05-18T22:13:21.334Z","avatar_url":"https://github.com/pfichtner.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go](https://github.com/pfichtner/mqtt-machine-state/actions/workflows/go.yml/badge.svg)](https://github.com/pfichtner/mqtt-machine-state/actions/workflows/go.yml)\n\n# mqtt-machine-state\n\nSend messages to mqtt broker on machine startups/shutdowns\nThis program does noting more than connecting to a mqtt broker, publishs a message (\"online\") and blocks until it gets killed (e.g. by ctrl+c). \nBefore gettting stopped it publishes another message (\"offline\"). Additionally it registers this message as last will testament (LWT) for the case the connection get's interrupetd. \n\n## Ok, what's that for!?\n\nI added this tiny program to the startup of my machines so each machine getting up and down publish their states to the mqtt broker, so you know which machines are up and which not. But the real value is that you can run automations on that. I have a server to which my workstations and servers can do their backups to. This backup server is not powered on permanently. When this server comes up the workstations should start doing there backups which now easily can be done by them by subscribing to the topic of the backup server (wait for the topic hostname-of-the-backupserver/status to be \"online\")\n\n```\n./mqttmachinestate -h\nUsage of ./mqttmachinestate:\n  -c, --config string   Config file name\n  -b, --broker string   MQTT broker host (default \"localhost\")\n  -p, --port int        MQTT broker port (default 1883)\n  -t, --topic string    MQTT topic (default \"$hostname/status\")\n  -r, --retained        Whether messages should be retained (default false)\n  -q, --qos int         Quality of Service (QoS) level (default 0)\npflag: help requested\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpfichtner%2Fmqtt-machine-state","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpfichtner%2Fmqtt-machine-state","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpfichtner%2Fmqtt-machine-state/lists"}