{"id":16565277,"url":"https://github.com/domochip/sun2mqtt","last_synced_at":"2026-05-19T04:09:20.307Z","repository":{"id":42659722,"uuid":"398361168","full_name":"Domochip/sun2mqtt","owner":"Domochip","description":"Docker image to get sun infos pushed through MQTT (sunrise / sunset, elevation, azimuth, etc ...)","archived":false,"fork":false,"pushed_at":"2024-11-25T23:18:27.000Z","size":61,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-05T08:36:19.420Z","etag":null,"topics":["mqtt","sun"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Domochip.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-20T18:00:42.000Z","updated_at":"2024-06-26T20:59:26.000Z","dependencies_parsed_at":"2025-03-05T08:31:06.352Z","dependency_job_id":"f27c4399-6457-4176-9eee-f6128c2fe9de","html_url":"https://github.com/Domochip/sun2mqtt","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Domochip/sun2mqtt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Domochip%2Fsun2mqtt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Domochip%2Fsun2mqtt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Domochip%2Fsun2mqtt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Domochip%2Fsun2mqtt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Domochip","download_url":"https://codeload.github.com/Domochip/sun2mqtt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Domochip%2Fsun2mqtt/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267163762,"owners_count":24045709,"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","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["mqtt","sun"],"created_at":"2024-10-11T20:46:40.728Z","updated_at":"2026-05-19T04:09:15.259Z","avatar_url":"https://github.com/Domochip.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Prerequisites\n\nNo.\nCalculations are done locally.\n\n# How does it work\n\nThis image publishes once a day some sun informations:  \n- all sunrise times \n- all sunset times\n- transit time, daylength\nAnd every minutes some live informations:\n- elevation and azimuth\n\n![Diagram](https://raw.githubusercontent.com/Domochip/sun2mqtt/master/diagram.svg)\n\n# How-to\n## Install\nFor Docker, run it by executing the following commmand:\n\n```bash\ndocker run \\\n    -d \\\n    --name sun2mqtt \\\n    --restart=always \\\n    -e TZ=\"Europe/Paris\" \\\n    -e PUBLISHHOUR=3 \\\n    -e LATITUDE=\"48.85826\" \\\n    -e LONGITUDE=\"2.29451\" \\\n    -e HOST=\"192.168.1.x\" \\\n    -e PORT=1883 \\\n    -e PREFIX=\"sun2mqtt\" \\\n    -e CLIENTID=\"sun2mqttclid\" \\\n    -e USER=\"usr\" \\\n    -e PASSWORD=\"pass\" \\\n    domochip/sun2mqtt\n```\nFor Docker-Compose, use the following yaml:\n\n```yaml\nversion: '3'\nservices:\n  sun2mqtt:\n    container_name: sun2mqtt\n    image: domochip/sun2mqtt\n    environment:\n    - TZ=Europe/Paris\n    - PUBLISHHOUR=0\n    - LATITUDE=48.85826\n    - LONGITUDE=2.29451\n    - HOST=192.168.1.x\n    - PORT=1883\n    - PREFIX=sun2mqtt\n    - CLIENTID=sun2mqttclid\n    - USER=mqtt_username\n    - PASSWORD=mqtt_password\n    restart: always\n```\n\n### Configure\n\n#### Environment variables\n* `TZ`: **Optional**, (Linux TimeZone) Timezone used to schedule publish and produce local time results\n* `PUBLISHHOUR`: **Optional**, (Integer: 0 to 23) hour of publish everyday\n* `LATITUDE`: **Optional**, (Float) latitude of the position for calculation\n* `LONGITUDE`: **Optional**, (Float) longitude of the position for calculation\n* `HOST`: IP address or hostname of your MQTT broker\n* `PORT`: **Optional**, port of your MQTT broker\n* `PREFIX`: **Optional**, prefix used in topics for subscribe/publish\n* `CLIENTID`: **Optional**, MQTT client id to use\n* `USER`: **Optional**, MQTT username\n* `PASSWORD`: **Optional**, MQTT password\n\n## Published Informations\n\n### Technical information\n\n* `{prefix}/connected`: 0 or 1, Indicates connection status of the container\n* `{prefix}/executionTime`: DateTime, execution time of the publication\n\n### Sunrise\n\nSunrise information: time formatted as \"hhmm\" (2 hours digits followed by 2 minutes digits)  \n* `{prefix}/sun/astronomicsunrise`: Astronomic sunrise\n* `{prefix}/sun/nauticsunrise`: Nautic Sunrise\n* `{prefix}/sun/civilsunrise`: Civil sunrise\n* `{prefix}/sun/sunrise`: Sunrise\n\n### Sunset\n\nSunset information: time formatted as \"hhmm\" (2 hours digits followed by 2 minutes digits)  \n* `{prefix}/sun/sunset`: Sunset\n* `{prefix}/sun/civilsunset`: Civil sunset\n* `{prefix}/sun/nauticsunset`: Nautic sunset\n* `{prefix}/sun/astronomicsunset`: Astronomic sunset\n\n### Other daily infos\n\nOther daily information:  \n* `{prefix}/sun/transit`: time formatted as \"hhmm\" (2 hours digits followed by 2 minutes digits), time when the sun is at its higher position\n* `{prefix}/sun/daylength`: daylength in minutes (time between sunrise and sunset)\n\n### Live Sun Position\n\nLive sun information published every minutes:  \n* `{prefix}/sunposition/elevation`: 0-90, Indicates the angle of the sun measured from the horizon\n* `{prefix}/sunposition/azimuth`: 0-360, The azimuth angle is the compass direction from which the sunlight is coming\n* `{prefix}/sunposition/daytime`: 0 or 1, indicates if sun is in the sky (between sunrise and sunset)\n\n# Troubleshoot\n## Logs\nYou need to have a look at logs using :  \n`docker logs sun2mqtt`\n\n# Updating\nTo update to the latest Docker image:\n```bash\ndocker stop sun2mqtt\ndocker rm sun2mqtt\ndocker rmi domochip/sun2mqtt\n# Now run the container again, Docker will automatically pull the latest image.\n```\n# Ref/Thanks\n\nI want to thanks a lot **Lunarok** for his Jeedom plugin Heliotrope which is the original code/idea of this Docker Image :  \n* https://github.com/lunarok/jeedom_heliotrope\n* https://market.jeedom.com/index.php?v=d\u0026p=market_display\u0026id=1482\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdomochip%2Fsun2mqtt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdomochip%2Fsun2mqtt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdomochip%2Fsun2mqtt/lists"}