Skip to content

lm-sensors, nvidia-smi and maybe more to mqtt and home assistant

License

Notifications You must be signed in to change notification settings

kevin-david/sensors2mqtt

This branch is 29 commits ahead of, 2 commits behind koriwi/sensors2mqtt:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

95cbf32 · Apr 25, 2024

History

31 Commits
Feb 28, 2024
Apr 25, 2024
Dec 9, 2023
Dec 9, 2023
Dec 9, 2023
Dec 9, 2023
Apr 16, 2024
Dec 9, 2023
Feb 28, 2024
Apr 22, 2024
Apr 16, 2024
Apr 16, 2024
Apr 16, 2024
Apr 16, 2024

Repository files navigation

Docker Pulls   GitHub Actions Workflow Status

pushes lm-sensors and nvidia-smi to mqtt. Also creates home assistant sensors for these resources

docker-compose.yml:

version: "3.9"
services:
  sensors2mqtt:
    container_name: sensors2mqtt
    privileged: true
    restart: unless-stopped
    image: kevinpdavid/sensors2mqtt:main
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              capabilities:
                - gpu
    environment:
      - MQTT_URL=mqtt://mosquitto
      # - MQTT_TOPIC=sensors2mqtt #this is the default
      - INTERVAL=5000 # In milliseconds
      # - MQTT_USERNAME=homeassistant
      # - MQTT_PASSWORD=<your password here>

Run as a service?

Sure thing:

################################################################################
# A template for docker-compose based service
# Can be put somewhere like /etc/systemd/system/sensors2mqtt.service
# Then enabled/started with `systemctl enable` and `systemctl start `
################################################################################
[Unit]
Description=Docker Compose sensors2mqtt Service
Requires=docker.service
After=docker.service

[Service]
User=kevin
Type=oneshot
RemainAfterExit=yes
WorkingDirectory=/home/kevin/sensors2mqtt
ExecStart=/usr/bin/docker compose up -d
ExecStop=/usr/bin/docker compose down
TimeoutStartSec=0

[Install]
WantedBy=multi-user.target

About

lm-sensors, nvidia-smi and maybe more to mqtt and home assistant

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 87.7%
  • Dockerfile 6.8%
  • JavaScript 5.5%