Docker image to get sun infos pushed through MQTT (sunrise / sunset, elevation, azimuth, etc ...)
592
No. Calculations are done locally.
This image publishes once a day some sun informations:
For Docker, run it by executing the following commmand:
docker run \
-d \
--name sun2mqtt \
--restart=always \
-e TZ="Europe/Paris" \
-e PUBLISHHOUR=3 \
-e LATITUDE="48.85826" \
-e LONGITUDE="2.29451" \
-e HOST="192.168.1.x" \
-e PORT=1883 \
-e PREFIX="sun2mqtt" \
-e CLIENTID="sun2mqttclid" \
-e USER="usr" \
-e PASSWORD="pass" \
domochip/sun2mqtt
For Docker-Compose, use the following yaml:
version: '3'
services:
sun2mqtt:
container_name: sun2mqtt
image: domochip/sun2mqtt
environment:
- TZ=Europe/Paris
- PUBLISHHOUR=0
- LATITUDE=48.85826
- LONGITUDE=2.29451
- HOST=192.168.1.x
- PORT=1883
- PREFIX=sun2mqtt
- CLIENTID=sun2mqttclid
- USER=mqtt_username
- PASSWORD=mqtt_password
restart: always
TZ: Optional, (Linux TimeZone) Timezone used to schedule publish and produce local time resultsPUBLISHHOUR: Optional, (Integer: 0 to 23) hour of publish everydayLATITUDE: Optional, (Float) latitude of the position for calculationLONGITUDE: Optional, (Float) longitude of the position for calculationHOST: IP address or hostname of your MQTT brokerPORT: Optional, port of your MQTT brokerPREFIX: Optional, prefix used in topics for subscribe/publishCLIENTID: Optional, MQTT client id to useUSER: Optional, MQTT usernamePASSWORD: Optional, MQTT password{prefix}/connected: 0 or 1, Indicates connection status of the container{prefix}/executionTime: DateTime, execution time of the publicationSunrise information: time formatted as "mmss" (2 hours digits followed by 2 minutes digits)
{prefix}/sun/astronomicsunrise: Astronomic sunrise{prefix}/sun/nauticsunrise: Nautic Sunrise{prefix}/sun/civilsunrise: Civil sunrise{prefix}/sun/sunrise: SunriseSunset information: time formatted as "mmss" (2 hours digits followed by 2 minutes digits)
{prefix}/sun/sunset: Sunset{prefix}/sun/civilsunset: Civil sunset{prefix}/sun/nauticsunset: Nautic sunset{prefix}/sun/astronomicsunset: Astronomic sunsetOther daily information:
{prefix}/sun/transit: time formatted as "mmss" (2 hours digits followed by 2 minutes digits), time when the sun is at its higher position{prefix}/sun/daylength: daylength in minutes (time between sunrise and sunset)School holidays information:
{prefix}/sunposition/elevation: 0-90, Indicates the angle of the sun measured from the horizon{prefix}/sunposition/azimuth: 0-360, The azimuth angle is the compass direction from which the sunlight is coming{prefix}/sunposition/daytime: 0 or 1, indicates if sun is in the sky (between sunrise and sunset)You need to have a look at logs using :
docker logs sun2mqtt
To update to the latest Docker image:
docker stop sun2mqtt
docker rm sun2mqtt
docker rmi domochip/sun2mqtt
# Now run the container again, Docker will automatically pull the latest image.
I want to thanks a lot Lunarok for his Jeedom plugin Heliotrope which is the original code/idea of this Docker Image :
Content type
Image
Digest
sha256:f53fa4bfd…
Size
34.6 MB
Last updated
over 2 years ago
docker pull domochip/sun2mqtt