{"id":15722943,"url":"https://github.com/soerenschneider/gobot-lux","last_synced_at":"2026-02-16T04:01:29.909Z","repository":{"id":38315530,"uuid":"406077914","full_name":"soerenschneider/gobot-lux","owner":"soerenschneider","description":"Gobot robot that reads and streams data from a brightness sensor","archived":false,"fork":false,"pushed_at":"2025-02-18T21:47:16.000Z","size":323,"stargazers_count":0,"open_issues_count":8,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-13T04:31:13.171Z","etag":null,"topics":["brightness","gobot","golang","home-assistant","mqtt","raspberry-pi","sensor"],"latest_commit_sha":null,"homepage":"","language":"Go","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/soerenschneider.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-13T18:02:34.000Z","updated_at":"2024-06-10T08:19:21.000Z","dependencies_parsed_at":"2024-01-26T22:27:33.914Z","dependency_job_id":"1097f65c-892a-4af3-a563-f461e1b15373","html_url":"https://github.com/soerenschneider/gobot-lux","commit_stats":{"total_commits":116,"total_committers":4,"mean_commits":29.0,"dds":"0.43103448275862066","last_synced_commit":"ca78f6491f9baf61dbd03a0a7720700b7f03e9ca"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/soerenschneider/gobot-lux","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soerenschneider%2Fgobot-lux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soerenschneider%2Fgobot-lux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soerenschneider%2Fgobot-lux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soerenschneider%2Fgobot-lux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/soerenschneider","download_url":"https://codeload.github.com/soerenschneider/gobot-lux/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soerenschneider%2Fgobot-lux/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29499802,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T03:57:51.541Z","status":"ssl_error","status_checked_at":"2026-02-16T03:55:59.854Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["brightness","gobot","golang","home-assistant","mqtt","raspberry-pi","sensor"],"created_at":"2024-10-03T22:09:46.967Z","updated_at":"2026-02-16T04:01:29.892Z","avatar_url":"https://github.com/soerenschneider.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gobot-lux\n[![Go Report Card](https://goreportcard.com/badge/github.com/soerenschneider/gobot-lux)](https://goreportcard.com/report/github.com/soerenschneider/gobot-lux)\n![test-workflow](https://github.com/soerenschneider/gobot-lux/actions/workflows/test.yaml/badge.svg)\n![release-workflow](https://github.com/soerenschneider/gobot-lux/actions/workflows/release.yaml/badge.svg)\n![golangci-lint-workflow](https://github.com/soerenschneider/gobot-lux/actions/workflows/golangci-lint.yaml/badge.svg)\n\nReads and forwards brightness data using an analogous brightness sensor and a Raspberry PI\n\n## Features\n\n🤖 Integrates with Home-Assistant\u003cbr/\u003e\n📊 Calculates statistics about brightness data over time windows, accessible via MQTT and metrics\u003cbr/\u003e\n🔐 Allows connecting to secure MQTT brokers using TLS client certificates\u003cbr/\u003e\n🔭 Expose brightness data as metrics to enable alerting and Grafana dashboards\u003cbr/\u003e\n\n## Installation\n\n### Binaries\nDownload a prebuilt binary from the [releases section](https://github.com/soerenschneider/gobot-lux/releases) for your system.\n\n### From Source\nAs a prerequisite, you need to have [Golang SDK](https://go.dev/dl/) installed. Then you can install gobot-lux from source by invoking:\n```shell\n$ go install github.com/soerenschneider/gobot-lux@latest\n```\n\n## Configuration\n\ngobot-lux can be fully configured using either environment variables or a config file. To supply a config file, the `-config` parameter is used.\n\n### Configuration Reference\n\n| Field                  | JSON Key                | Environment Variable               | Validation Rules                                        |\n|------------------------|-------------------------|------------------------------------|---------------------------------------------------------|\n| Placement              | placement               | GOBOT_LUX_PLACEMENT                | required                                                |\n| MetricConfig           | metrics_addr            | GOBOT_LUX_METRICS_LISTEN_ADDR      | optional, must be a valid TCP address                   |\n| IntervalSecs           | interval_s              | GOBOT_LUX_INTERVAL_S               | minimum: 1, maximum: 300                                |\n| StatIntervals          | stat_intervals          | GOBOT_LUX_STAT_INTERVALS           | each value: minimum: 10, maximum: 3600                  |\n| LogSensor              | log_sensor              | GOBOT_LUX_LOG_SENSOR_READINGS      |                                                         |\n| MqttConfig             |                         |                                    |                                                         |\n| - Host                 | mqtt_host               | GOBOT_LUX_MQTT_BROKER              | required, must be a valid MQTT broker                   |\n| - Topic                | mqtt_topic              | GOBOT_LUX_MQTT_TOPIC               | required, must be a valid MQTT topic                    |\n| - StatsTopic           | mqtt_stats_topic        | GOBOT_LUX_MQTT_STATS_TOPIC         | optional, must be a valid MQTT topic                    |\n| - ClientKeyFile        | mqtt_ssl_key_file       | GOBOT_LUX_MQTT_TLS_CLIENT_KEY_FILE | required unless ClientCertFile is empty, must be a file |\n| - ClientCertFile       | mqtt_ssl_cert_file      | GOBOT_LUX_MQTT_TLS_CLIENT_CRT_FILE | required unless ClientKeyFile is empty, must be a file  |\n| - ServerCaFile         | mqtt_ssl_ca_file        | GOBOT_LUX_MQTT_TLS_SERVER_CA_FILE  | optional, must be a file                                |\n| SensorConfig           |                         |                                    |                                                         |\n| - FirmAtaPort          | firmata_port            | GOBOT_LUX_FIRMATA_PORT             | required                                                |\n| - AioPin               | aio_pin                 | GOBOT_LUX_AIO_PIN                  | required, must be a number                              |\n| - AioPollingIntervalMs | aio_polling_interval_ms | GOBOT_LUX_AIO_POLLING_MS           | required, minimum: 1000, maximum: 60000                 |\n\n### Example Config\n\n```json\n{\n  \"aio_pin\": \"0\",\n  \"aio_polling_interval_ms\": 1000,\n  \"interval_s\": 1,\n  \"mqtt_host\": \"ssl://mqtt.eclipse.org:8883\",\n  \"mqtt_ssl_cert_file\": \"/etc/passwd\",\n  \"mqtt_ssl_key_file\": \"/etc/passwd\",\n  \"mqtt_stats_topic\": \"lux/corridor_stats\",\n  \"mqtt_topic\": \"lux/corridor\",\n  \"placement\": \"corridor\",\n  \"metrics_addr\": \"0.0.0.0:9192\"\n}\n```\n\n## Metrics\nThis project exposes the following metrics in Open Metrics format under the prefix `gobot_lux`\n\n| Metric Name                  | Metric Type  | Description                                                      | Labels              |\n|------------------------------|--------------|------------------------------------------------------------------|---------------------|\n| version                      | GaugeVec     | Version information of this robot                                | version, commit     |\n| heartbeat_seconds            | Gauge        | Continuous heartbeat of this bot                                 |                     |\n| brightness_level_percent     | GaugeVec     | Current sensor reading of brightness level                       | placement           |\n| read_errors_total            | CounterVec   | Errors while reading the sensor                                  | placement           |\n| messages_published_total     | CounterVec   | Total number of published messages via MQTT                      | placement           |\n| message_publish_errors_total | CounterVec   | Total number of errors while trying to publish messages via MQTT | placement           |\n| min_per_interval_percent     | GaugeVec     | Minimum sensor value during given intervals                      | interval, placement |\n| max_per_interval_percent     | GaugeVec     | Maximum sensor value during given intervals                      | interval, placement |\n| delta_per_interval_percent   | GaugeVec     | Delta sensor value during given intervals                        | interval, placement |\n| avg_per_interval_percent     | GaugeVec     | Avg sensor value during given intervals                          | interval, placement |\n| slice_entries_total          | GaugeVec     | The amount of entries in the stats slice                         | placement           |\n\n\n## Changelog\nThe full changelog can be found [here](CHANGELOG.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoerenschneider%2Fgobot-lux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoerenschneider%2Fgobot-lux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoerenschneider%2Fgobot-lux/lists"}