Publish GPU miner info to MQTT

Overview

Miner2MQTT

Доступ к вашему GPU майнеру через MQTT.

Изменения

1.0
  • EXE файл для Windows
1.1
  • Управление вентиляторами видеокарт (Linux)

  • Упраление power limit видеокарт (требуется SU) (Linux)

Описание

Поддерживаемые ОС

  • Linux
  • Windows (не тестировалось)

Поддерживаемые майнеры

  • T-Rex

Воможности:

  • Публикация всей информации от майнера в MQTT
  • Возможность выборочной публикации (INCLUDE и EXCLUDE параметры в config.yaml)
  • Обновление с указанным интервалом или по требованию (путем публикации "ON" в ваш_топик/to_miner/refresh)
Управление вентиляторами видеокарт
  • Изменение скорости: публикация значения в процентах в топик ваш_топик/to_miner/ /fan_speed , топик с текущими значениями в процентах ваш_топик/from_miner/ /fan_speed .
  • Включение вентилятора: публикация значения ON в топик ваш_топик/to_miner/ /fan_state , топик с текущим состоянием ваш_топик/from_miner/ /fan_state .
  • Изменение режима auto/manual: публикация значения auto / manualв топик ваш_топик/to_miner/ /fan_mode , топик с текущим режимом ваш_топик/from_miner/ /fan_mode .
Управление power limit видеокарт
  • Изменение power limit: публикация значения в процентах в топик ваш_топик/to_miner/ /power_limit , топик с текущими значениями в процентах ваш_топик/from_miner/ /power_limit .
  • Для изменения power limit требуются права SU, необходимо либо вписать SUDO_PASS в config.yaml либо запускать m2m.py с правами sudo.

Установка:

Ubuntu
sudo apt install python3-setuptools
git clone https://github.com/bds89/miner2mqtt.git
cd miner2mqtt
sudo python3 setup.py install   
gedit m2m/config.yaml   #Редактируем config.yaml

Запуск:

python3 m2m/m2m.py

Обновление:

  • Сохраните ваш config.yaml
    cd miner2mqtt
    git pull origin
  • Скопируйте ваш сохраненный config.yaml в miner2mqtt/m2m

Редактирование config.yaml:

MINER: Trex
    #выбор GPU майнера, на данный моменр только T-rex
SUDO_PASS: pass
    #пароль суперпользователя, для изменения power_limit
MQTT:
  TOPIC: miner2mqtt/rig0
  HOST: 192.168.0.120
  USERNAME: user
  PASS: pass
    #Подключение к вашему MQTT
INTERVAL: 300
    #интервал сбора и публикации информации в секундах
INCLUDE:
- active_pool
- gpus
EXCLUDE: {}
    #фильтры по ключам из JSON словаря вашего майнера (поддерживаются только ключи первого уровня)

Примеры интеграции в Home Asistant:

Сборный сенсор GPU0
{ "name": "{{value_json.gpus.0.name}}", "temperature": "{{value_json.gpus.0.temperature}}", "fan_speed": "{{value_json.gpus.0.fan_speed}}", "power": "{{value_json.gpus.0.power}}", "efficiency": "{{value_json.gpus.0.efficiency}}" } ">
sensor:
  - platform: mqtt
    name: "GPU0"
    state_topic: "miner2mqtt/rig0"
    unit_of_measurement: "MH/s"
    value_template: "{{ (value_json.gpus.0.hashrate_minute/1000000)|round(2) }}"
    device_class: power
    expire_after: 660
    json_attributes_topic: "miner2mqtt/rig0"
    json_attributes_template: >
      { "name": "{{value_json.gpus.0.name}}",
        "temperature": "{{value_json.gpus.0.temperature}}",
        "fan_speed": "{{value_json.gpus.0.fan_speed}}",
        "power": "{{value_json.gpus.0.power}}",
        "efficiency": "{{value_json.gpus.0.efficiency}}" }
Отдельные сенсоры
sensor:
  - platform: mqtt
    name: "GPU0_hash"
    state_topic: "miner2mqtt/rig0"
    unit_of_measurement: "MH/s"
    value_template: "{{ (value_json.gpus.0.hashrate_minute/1000000)|round(2) }}"
    device_class: power
    expire_after: 660
    json_attributes_topic: "miner2mqtt/rig0"

  - platform: mqtt
    name: "GPU0_name"
    state_topic: "miner2mqtt/rig0"
    value_template: "{{value_json.gpus.0.vendor|string + ' '|string + value_json.gpus.0.name|string}}"
    json_attributes_topic: "miner2mqtt/rig0"
    
  - platform: mqtt
    name: "GPU0_temperature"
    state_topic: "miner2mqtt/rig0"
    unit_of_measurement: "°C"
    value_template: "{{value_json.gpus.0.temperature}}"
    expire_after: 660
    json_attributes_topic: "miner2mqtt/rig0"
    
  - platform: mqtt
    name: "GPU0_fan_speed"
    state_topic: "miner2mqtt/rig0"
    unit_of_measurement: "%"
    value_template: "{{value_json.gpus.0.fan_speed}}"
    device_class: power_factor
    expire_after: 660
    json_attributes_topic: "miner2mqtt/rig0"
    
  - platform: mqtt
    name: "GPU0_power"
    state_topic: "miner2mqtt/rig0"
    unit_of_measurement: "kW/h"
    value_template: "{{value_json.gpus.0.power}}"
    device_class: power
    expire_after: 660
    json_attributes_topic: "miner2mqtt/rig0"   
    
  - platform: mqtt
    name: "GPU0_efficiency"
    state_topic: "miner2mqtt/rig0"
    unit_of_measurement: "kH/W"
    value_template: "{{value_json.gpus.0.efficiency.split('kH/W')[0]|int}}"
    device_class: power
    expire_after: 660
    json_attributes_topic: "miner2mqtt/rig0" 
Кнопка обновить
switch:
  - platform: mqtt
    unique_id: m2m_refresh
    name: "m2m_refresh"
    state_topic: "miner2mqtt/rig0/to_miner/refresh"
    command_topic: "miner2mqtt/rig0/to_miner/refresh"
    payload_on: "ON"
    payload_off: "OFF"
    state_on: "ON"
    state_off: "OFF"
Вентилятор
fan:
  - platform: mqtt
    name: "GPU0_fan"
    state_topic: "miner2mqtt/rig0/from_miner/0/fan_state"
    command_topic: "miner2mqtt/rig0/to_miner/0/fan_state"
    percentage_state_topic: "miner2mqtt/rig0/from_miner/0/fan_speed"
    percentage_command_topic: "miner2mqtt/rig0/to_miner/0/fan_speed"
    preset_mode_state_topic: "miner2mqtt/rig0/from_miner/0/fan_mode"
    preset_mode_command_topic: "miner2mqtt/rig0/to_miner/0/fan_mode"
    preset_modes:
      -  "auto"
      -  "manual"
Power limit видеокарты (вариант light.)
light:
  - platform: mqtt
    name: "GPU0_power_limit"
    state_topic: "miner2mqtt/rig0/from_miner/0/state"
    command_topic: "miner2mqtt/rig0/to_miner/0/state"
    icon: mdi:lightning-bolt-circle
    brightness_scale: 240
    max_mireds: 240
    min_mireds: 100
    brightness_state_topic: "miner2mqtt/rig0/from_miner/0/power_limit"
    brightness_command_topic: "miner2mqtt/rig0/to_miner/0/power_limit"
Power limit видеокарты (вариант number.)
number:
  - platform: mqtt
    name: "GPU0_power_limit"
    state_topic: "miner2mqtt/rig0/from_miner/0/power_limit"
    command_topic: "miner2mqtt/rig0/to_miner/0/power_limit"
    icon: mdi:lightning-bolt-circle
    min: 100
    max: 240

Планы

  • Windows
  • Управление майнером
  • NBMiner
You might also like...
SamrSearch - SamrSearch can get user info and group info with MS-SAMR
SamrSearch - SamrSearch can get user info and group info with MS-SAMR

SamrSearch SamrSearch can get user info and group info with MS-SAMR.like net use

Lazy Profiler is a simple utility to collect CPU, GPU, RAM and GPU Memory stats while the program is running.
Lazy Profiler is a simple utility to collect CPU, GPU, RAM and GPU Memory stats while the program is running.

lazyprofiler Lazy Profiler is a simple utility to collect CPU, GPU, RAM and GPU Memory stats while the program is running. Installation Use the packag

General purpose GPU compute framework for cross vendor graphics cards (AMD, Qualcomm, NVIDIA & friends). Blazing fast, mobile-enabled, asynchronous and optimized for advanced GPU data processing usecases.
General purpose GPU compute framework for cross vendor graphics cards (AMD, Qualcomm, NVIDIA & friends). Blazing fast, mobile-enabled, asynchronous and optimized for advanced GPU data processing usecases.

Vulkan Kompute The general purpose GPU compute framework for cross vendor graphics cards (AMD, Qualcomm, NVIDIA & friends). Blazing fast, mobile-enabl

nvitop, an interactive NVIDIA-GPU process viewer, the one-stop solution for GPU process management
nvitop, an interactive NVIDIA-GPU process viewer, the one-stop solution for GPU process management

An interactive NVIDIA-GPU process viewer, the one-stop solution for GPU process management.

Multiple types of NN model optimization environments. It is possible to directly access the host PC GUI and the camera to verify the operation. Intel iHD GPU (iGPU) support. NVIDIA GPU (dGPU) support.
Multiple types of NN model optimization environments. It is possible to directly access the host PC GUI and the camera to verify the operation. Intel iHD GPU (iGPU) support. NVIDIA GPU (dGPU) support.

mtomo Multiple types of NN model optimization environments. It is possible to directly access the host PC GUI and the camera to verify the operation.

High performance Cross-platform Inference-engine, you could run Anakin on x86-cpu,arm, nv-gpu, amd-gpu,bitmain and cambricon devices.

Anakin2.0 Welcome to the Anakin GitHub. Anakin is a cross-platform, high-performance inference engine, which is originally developed by Baidu engineer

GrabGpu_py: a scripts for grab gpu when gpu is free

GrabGpu_py a scripts for grab gpu when gpu is free. WaitCondition: gpu_memory

The Intelligent Bitcoin Miner, Part II

The Intelligent Bitcoin Miner, Part II At a Glance This app simulates the behavior and profitability of Bitcoin miners for The Intelligent Bitcoin Min

Another Provably Rare Gem Miner 💎 (for Raritygems)

Provably Rare Gem Miner Go (for Rarity) Pull Request is strongly welcome as I don't know anything about Golang/Python/Web3. Usage Install Python 3.x i

Deep Web Miner Python | Spyder Crawler

Webcrawler written in Python. This crawler does dig in till the 3 level of inside addressed and mine the respective data accordingly

XMRiGUI is free and open-source crypto miner for Linux. It uses XMRig for mining and GTK3 for GUI.
XMRiGUI is free and open-source crypto miner for Linux. It uses XMRig for mining and GTK3 for GUI.

XMRiGUI is free and open-source crypto miner for Linux. It uses XMRig for mining and GTK3 for GUI.

Que es S4K Builder?, Fácil un constructor de tokens grabbers con muchas opciones, como BTC Miner, Clipper, shutdown PC, Y más! Disfrute el proyecto. 3

S4K Builder Este script Python 3 de código abierto es un constructor del muy popular registrador de tokens que está en [mi GitHub] (https://github.com

Basic Ethereum Miner Lib

EthMine ⛏ Basic Ethereum Miner Library. Developers can integrate this algorithm to mine blocks from their ethereum supported chain efficiently. Instal

Turn crypto miner on/off depending on powerwall charge level

Mining Crypto with Tesla Solar and Powerwalls This script turns a crypto miner on and off when the Tesla Powerwall level drops/rises above a certain t

This tool help you to check if your Windows machine has hidden miner.

Hidden Miner Detector This tool help you to check if your Windows machine has hidden miner. Miners track when you open antivirus software or task mana

Twitch Points Miner for multiple accounts with Discord logging

Twitch Points Miner for multiple accounts with Discord logging Creator of the Twitch Miner -- PLEASE NOTE THIS IS PROBABLY BANNABLE -- Made on python

This is simple Blockchain ,miner and wallet to send crypto using python

pythonBlockchain-SImple This is simple Blockchain ,miner and wallet to send crypto using python It is simple Blocchain so it can only dobasic work usi

TON Miner from TON-Pool.com

TON-Pool Miner Miner from TON-Pool.com

A DUCO (Duino-Coin) miner for GigaDevice ARM boards.
A DUCO (Duino-Coin) miner for GigaDevice ARM boards.

GD32 Duino-Coin Miner Description Contains the firmware and miner software for mining DUCO (Duino-Coin) on GigaDevice GD32 chips. Supported boards GD3

Comments
  • "WARNING: No data from miner"

    I have been trying to make this work with ubuntu for my Trex miner. I am getting message "WARNING: No data from miner". The following is my config.

    MINER: Trex
    SUDO_PASS: passwor
    MQTT:
      TOPIC: miner2mqtt/ther
      HOST: 192.168.xx.xxx
      USERNAME: sxxxx
      PASS: xxxxx
    INTERVAL: 20
    INCLUDE:
    - active_pool
    - gpus
    - sys_params
    EXCLUDE: {}
    

    I have enabled api key for Trex. Could it be the reason?

    opened by sheminasalam 14
  • Installation

    Installation

    Having problems during installation, what version of python is required? Python 3.6.9 is currently installed.

    root@intel:/media/miner2mqtt# sudo python3 setup.py install
    running install
    running bdist_egg
    running egg_info
    writing miner2mqtt.egg-info/PKG-INFO
    writing dependency_links to miner2mqtt.egg-info/dependency_links.txt
    writing requirements to miner2mqtt.egg-info/requires.txt
    writing top-level names to miner2mqtt.egg-info/top_level.txt
    reading manifest file 'miner2mqtt.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no files found matching '*.yaml' under directory 'm2m'
    writing manifest file 'miner2mqtt.egg-info/SOURCES.txt'
    installing library code to build/bdist.linux-x86_64/egg
    running install_lib
    running build_py
    warning: build_py: byte-compiling is disabled, skipping.
    
    creating build/bdist.linux-x86_64/egg
    creating build/bdist.linux-x86_64/egg/m2m_Linux
    copying build/lib/m2m_Linux/__init__.py -> build/bdist.linux-x86_64/egg/m2m_Linux
    copying build/lib/m2m_Linux/m2m.py -> build/bdist.linux-x86_64/egg/m2m_Linux
    warning: install_lib: byte-compiling is disabled, skipping.
    
    creating build/bdist.linux-x86_64/egg/EGG-INFO
    copying miner2mqtt.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
    copying miner2mqtt.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
    copying miner2mqtt.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
    copying miner2mqtt.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
    copying miner2mqtt.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
    zip_safe flag not set; analyzing archive contents...
    creating 'dist/miner2mqtt-1.6.1-py3.6.egg' and adding 'build/bdist.linux-x86_64/egg' to it
    removing 'build/bdist.linux-x86_64/egg' (and everything under it)
    Processing miner2mqtt-1.6.1-py3.6.egg
    Removing /usr/local/lib/python3.6/dist-packages/miner2mqtt-1.6.1-py3.6.egg
    Copying miner2mqtt-1.6.1-py3.6.egg to /usr/local/lib/python3.6/dist-packages
    miner2mqtt 1.6.1 is already the active version in easy-install.pth
    
    Installed /usr/local/lib/python3.6/dist-packages/miner2mqtt-1.6.1-py3.6.egg
    Processing dependencies for miner2mqtt==1.6.1
    Searching for MarkupSafe>=2.1.1
    Reading https://pypi.python.org/simple/MarkupSafe/
    Downloading https://files.pythonhosted.org/packages/1d/97/2288fe498044284f39ab8950703e88abbac2abbdf65524d576157af70556/MarkupSafe-2.1.1.tar.gz#sha256=7f91197cc9e48f989d12e4e6fbc46495c446636dfc81b9ccf50bb0ec74b91d4b
    Best match: MarkupSafe 2.1.1
    Processing MarkupSafe-2.1.1.tar.gz
    Writing /tmp/easy_install-z3ls1hos/MarkupSafe-2.1.1/setup.cfg
    Running MarkupSafe-2.1.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-z3ls1hos/MarkupSafe-2.1.1/egg-dist-tmp-j8n86svh
    error: SandboxViolation: chmod('/home/user/.cache/Python-Eggs/MarkupSafe-2.0.1-py3.6-linux-x86_64.egg-tmp/markupsafe/tmpfoxh7n_i.$extract', 493) {}
    
    The package setup script has attempted to modify files on your system
    that are not within the EasyInstall build area, and has been aborted.
    
    This package cannot be safely installed by EasyInstall, and may not
    support alternate installation locations even if you run its setup
    script by hand.  Please inform the package's author and the EasyInstall
    maintainers to find out if a fix or workaround is available.
    
    opened by dmsergeevich63 3
Owner
Dmitry Bukhvalov
Dmitry Bukhvalov
Solismod - A script subscribes to MQTT topics and waits for a message

SolisMod This is a first attempt to modify Solis inverter settings As SolisMon3,

null 9 Nov 14, 2022
A simple python script that parses the MSFT Teams log file for the users current Teams status and then outputs the status color to a MQTT connected light.

Description A simple python script that parses the MSFT Teams log file for the users current Teams status and then outputs the status color to a MQTT

Lorentz Factr 8 Dec 16, 2022
Interact remotely with the computer using Python and MQTT protocol 💻

Comandos_Remotos Interagir remotamento com o computador através do Python e protocolo MQTT. ?? Status: em desenvolvimento ?? Objetivo: Interagir com o

Guilherme_Donizetti 6 May 10, 2022
These scripts send notifications to a Webex space when a new IP is banned by Expressway, and allow to request more info or change the ban status

Spam Call and Toll Fraud Mitigation Cisco Expressway release X14 is able to mitigate spam calls and toll fraud attempts by jailing the spam IP address

Luca Pellegrini 6 Aug 5, 2022
Build custom OSINT tools and APIs (Ping, Traceroute, Scans, Archives, DNS, Scrape, Whois, Metadata & built-in database for more info) with this python package

Build custom OSINT tools and APIs with this python package - It includes different OSINT modules (Ping, Traceroute, Scans, Archives, DNS, Scrape, Whoi

QeeqBox 52 Jan 6, 2023
Mkdocs obsidian publish - Publish your obsidian vault through a python script

Mkdocs Obsidian Mkdocs Obsidian is an association between a python script and a

Mara 49 Jan 9, 2023
Use Raspberry Pi and CircuitSetup's power monitor hardware to publish electrical usage to MQTT

This repo has code and notes for whole home electrical power monitoring using a Raspberry Pi and CircuitSetup modules. Beyond just collecting data, it

Eric Tsai 10 Jul 25, 2022
fastapi-mqtt is extension for MQTT protocol

fastapi-mqtt MQTT is a lightweight publish/subscribe messaging protocol designed for M2M (machine to machine) telemetry in low bandwidth environments.

Sabuhi 144 Dec 28, 2022
fastapi-mqtt is extension for MQTT protocol

fastapi-mqtt MQTT is a lightweight publish/subscribe messaging protocol designed for M2M (machine to machine) telemetry in low bandwidth environments.

Sabuhi 23 Feb 11, 2021
Python-Stock-Info-CLI: Get stock info through CLI by passing stock ticker.

Python-Stock-Info-CLI Get stock info through CLI by passing stock ticker. Installation Use the following command to install the required modules at on

Ayush Soni 1 Nov 5, 2021