-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mulitipel Nano3 #458
Comments
The issue is that the MAC address can't be sourced on those for some reason. Not sure if there is a way to get it via the API or something that you know of? |
i started with chatgpt to make this script. `import paho.mqtt.client as mqtt Logging-Konfigurationlogging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s") Funktion zum Laden der Konfiguration aus der options.json-Dateidef load_config(config_file="/data/options.json"): Funktion zum Ausführen des 'socat'-Befehlsdef get_stats_from_device(ip, port): Funktion zum Extrahieren von Variablen aus einem Textstringdef extract_variables(text, pattern=r'(\w+)=([\d.]+|[a-zA-Z%]+|[.*?])'): Funktion zum Extrahieren der ID0-Datendef extract_id0_variables(text): Funktion zum Extrahieren der Pool-Datendef extract_pool_data(text): Veröffentliche Discovery-Daten im richtigen Pfaddef publish_discovery(client, unique_id, name, state_topic, device): Funktion zum Veröffentlichen der Daten in MQTTdef publish_data(client, data, topic_prefix, miner):
MQTT-Client initialisieren und verbindenclient = mqtt.Client() def on_connect(client, userdata, flags, rc): Funktion zum zyklischen Abrufen und Veröffentlichen der Datendef cyclic_data_fetch(miners, interval, topic_prefix): Lade die Konfiguration aus der options.jsonconfig = load_config() Setze MQTT-Konfigurationmqtt_broker = config["mqtt_broker"] Zyklische Datenabfrage startentry: it makes a list with all variables. i found HDNA[020100005e2a2d27] HDNA[02010000d9b3f28e] on booth of my miners. |
Sorry to say that this is entirely unhelpful, and although the HDNA item in the stats might be a good lead, it doesn't fit the format of MAC addresses. I can already parse the stats, that's no issue, but maybe if you are able to send just the raw stats result I could take a look at that? If you want to run it through ChatGPT, you need to know how to send the JSON |
i have only the nano3 miner and want it in Homeassistant for simple view. thats what your hacs do ;) miner1 Socat: Miner 2: |
Perfect, that helps a lot, I'll try to get it in there, maybe I can use something here at the very least. |
Ok, second look it seems like pyasic wants to parse it from Sorry that this is such a pain to get working, miners can be really weird sometimes :/ |
Miner 1: Miner 2: Oh yeah.. i try it since 5 days without any ideas what i do :) |
Version of the custom_component
1.1.20
Configuration
Describe the bug
i have multiple Nano3 Miner and only on is added in the Add-On
Debug log
2024-12-31 17:43:40.528 DEBUG (MainThread) [custom_components.miner.coordinator] Found miner: Avalon Nano 3 (Stock): 192.168.178.73
2024-12-31 17:43:40.629 DEBUG (MainThread) [custom_components.miner.coordinator] Got data: MinerData(ip='192.168.178.73', datetime='2024-12-31T17:43:40.529016+01:00', timestamp=1735663420, device_info=DeviceInfo(make=<MinerMake.AVALONMINER: 'AvalonMiner'>, model=<AvalonminerModels.AvalonNano3: 'Avalon Nano 3'>, firmware=<MinerFirmware.STOCK: 'Stock'>, algo=SHA256Algo), make='AvalonMiner', model='Avalon Nano 3', firmware='Stock', algo='SHA256', mac=None, api_ver=None, fw_ver='4.11.1', hostname=None, hashrate=3.89235 TH/s, expected_hashrate=4.36712 TH/s, expected_hashboards=1, expected_chips=10, expected_fans=1, percent_expected_chips=100, percent_expected_hashrate=89, percent_expected_wattage=None, temperature_avg=90, env_temp=None, wattage=None, wattage_limit=125, voltage=None, fans=[Fan(speed=4590)], fan_psu=None, hashboards=[HashBoard(slot=0, hashrate=3.89235 TH/s, temp=90, chip_temp=98, chips=10, expected_chips=10, serial_number=None, missing=False, tuned=None, active=None, voltage=None)], total_chips=10, nominal=True, config=MinerConfig(pools=PoolConfig(groups=[PoolGroup(pools=[Pool(url='stratum+tcp://stratum.braiins.com:3333', user='XYZ.Nano3-black', password='x'), Pool(url='stratum+tcp://bch.poolbinance.com:1800', user='XYZ.Nano3-black', password='x'), Pool(url='stratum+tcp://bch.poolbinance.com:3333', user='XYZ.Nano3-black', password='x')], quota=1, name='SUDT4R')]), fan_mode=FanModeNormal(mode='normal', minimum_fans=1, minimum_speed=0), temperature=TemperatureConfig(target=None, hot=None, danger=None), mining_mode=MiningModeNormal(mode='normal')), fault_light=None, errors=[], is_mining=True, uptime=None, efficiency=None, pools=[])
2024-12-31 17:43:40.630 DEBUG (MainThread) [custom_components.miner.coordinator] Finished fetching Nano3 Black data in 0.275 seconds (success: True)
2024-12-31 17:43:41.323 DEBUG (MainThread) [custom_components.miner.coordinator] Found miner: Avalon Nano 3 (Stock): 192.168.123.62
2024-12-31 17:43:41.380 DEBUG (MainThread) [custom_components.miner.coordinator] Got data: MinerData(ip='192.168.123.62', datetime='2024-12-31T17:43:41.323980+01:00', timestamp=1735663421, device_info=DeviceInfo(make=<MinerMake.AVALONMINER: 'AvalonMiner'>, model=<AvalonminerModels.AvalonNano3: 'Avalon Nano 3'>, firmware=<MinerFirmware.STOCK: 'Stock'>, algo=SHA256Algo), make='AvalonMiner', model='Avalon Nano 3', firmware='Stock', algo='SHA256', mac=None, api_ver=None, fw_ver='4.11.1', hostname=None, hashrate=3.67521 TH/s, expected_hashrate=4.2 TH/s, expected_hashboards=1, expected_chips=10, expected_fans=1, percent_expected_chips=100, percent_expected_hashrate=88, percent_expected_wattage=None, temperature_avg=90, env_temp=None, wattage=None, wattage_limit=125, voltage=None, fans=[Fan(speed=3990)], fan_psu=None, hashboards=[HashBoard(slot=0, hashrate=3.67521 TH/s, temp=90, chip_temp=93, chips=10, expected_chips=10, serial_number=None, missing=False, tuned=None, active=None, voltage=None)], total_chips=10, nominal=True, config=MinerConfig(pools=PoolConfig(groups=[PoolGroup(pools=[Pool(url='stratum+tcp://stratum.braiins.com:3333', user='XYZ.Nano3-blue', password='x'), Pool(url='stratum+tcp://bch.poolbinance.com:1800', user='XYZ.Nano3-blue', password='x'), Pool(url='stratum+tcp://bch.poolbinance.com:3333', user='XYZ.Nano3-blue', password='x')], quota=1, name='WI6O9G')]), fan_mode=FanModeNormal(mode='normal', minimum_fans=1, minimum_speed=0), temperature=TemperatureConfig(target=None, hot=None, danger=None), mining_mode=MiningModeNormal(mode='normal')), fault_light=None, errors=[], is_mining=True, uptime=None, efficiency=None, pools=[])
2024-12-31 17:43:41.380 DEBUG (MainThread) [custom_components.miner.coordinator] Finished fetching Nano3 Blue data in 0.123 seconds (success: True)
2024-12-31 17:43:41.612 DEBUG (MainThread) [custom_components.miner.coordinator] Found miner: Avalon Nano 3 (Stock): 192.168.123.62
2024-12-31 17:43:41.622 DEBUG (MainThread) [custom_components.miner.coordinator] Found miner: Avalon Nano 3 (Stock): 192.168.123.62
2024-12-31 17:43:41.627 DEBUG (MainThread) [custom_components.miner.coordinator] Found miner: Avalon Nano 3 (Stock): 192.168.123.62
2024-12-31 17:43:41.632 DEBUG (MainThread) [custom_components.miner.coordinator] Found miner: Avalon Nano 3 (Stock): 192.168.123.62
2024-12-31 17:43:41.673 DEBUG (MainThread) [custom_components.miner.coordinator] Got data: MinerData(ip='192.168.123.62', datetime='2024-12-31T17:43:41.612995+01:00', timestamp=1735663421, device_info=DeviceInfo(make=<MinerMake.AVALONMINER: 'AvalonMiner'>, model=<AvalonminerModels.AvalonNano3: 'Avalon Nano 3'>, firmware=<MinerFirmware.STOCK: 'Stock'>, algo=SHA256Algo), make='AvalonMiner', model='Avalon Nano 3', firmware='Stock', algo='SHA256', mac=None, api_ver=None, fw_ver='4.11.1', hostname=None, hashrate=3.6752 TH/s, expected_hashrate=4.2 TH/s, expected_hashboards=1, expected_chips=10, expected_fans=1, percent_expected_chips=100, percent_expected_hashrate=88, percent_expected_wattage=None, temperature_avg=90, env_temp=None, wattage=None, wattage_limit=125, voltage=None, fans=[Fan(speed=3990)], fan_psu=None, hashboards=[HashBoard(slot=0, hashrate=3.6752 TH/s, temp=90, chip_temp=93, chips=10, expected_chips=10, serial_number=None, missing=False, tuned=None, active=None, voltage=None)], total_chips=10, nominal=True, config=MinerConfig(pools=PoolConfig(groups=[PoolGroup(pools=[Pool(url='stratum+tcp://stratum.braiins.com:3333', user='XYZ.Nano3-blue', password='x'), Pool(url='stratum+tcp://bch.poolbinance.com:1800', user='XYZ.Nano3-blue', password='x'), Pool(url='stratum+tcp://bch.poolbinance.com:3333', user='XYZ.Nano3-blue', password='x')], quota=1, name='HF1IIC')]), fan_mode=FanModeNormal(mode='normal', minimum_fans=1, minimum_speed=0), temperature=TemperatureConfig(target=None, hot=None, danger=None), mining_mode=MiningModeNormal(mode='normal')), fault_light=None, errors=[], is_mining=True, uptime=None, efficiency=None, pools=[])
2024-12-31 17:43:41.674 DEBUG (MainThread) [custom_components.miner.coordinator] Finished fetching Nano3 Blue data in 0.292 seconds (success: True)
2024-12-31 17:43:41.674 ERROR (MainThread) [homeassistant.components.sensor] Platform miner does not generate unique IDs. ID None-hashrate already exists - ignoring sensor.nano3_black_hashrate
2024-12-31 17:43:41.674 ERROR (MainThread) [homeassistant.components.sensor] Platform miner does not generate unique IDs. ID None-ideal_hashrate already exists - ignoring sensor.nano3_black_ideal_hashrate
2024-12-31 17:43:41.675 ERROR (MainThread) [homeassistant.components.sensor] Platform miner does not generate unique IDs. ID None-temperature already exists - ignoring sensor.nano3_black_temperature
2024-12-31 17:43:41.675 ERROR (MainThread) [homeassistant.components.sensor] Platform miner does not generate unique IDs. ID None-power_limit already exists - ignoring sensor.nano3_black_power_limit
2024-12-31 17:43:41.675 ERROR (MainThread) [homeassistant.components.sensor] Platform miner does not generate unique IDs. ID None-miner_consumption already exists - ignoring sensor.nano3_black_miner_consumption
2024-12-31 17:43:41.675 ERROR (MainThread) [homeassistant.components.sensor] Platform miner does not generate unique IDs. ID None-efficiency already exists - ignoring sensor.nano3_black_efficiency
2024-12-31 17:43:41.675 ERROR (MainThread) [homeassistant.components.sensor] Platform miner does not generate unique IDs. ID None-0-board_temperature already exists - ignoring sensor.nano3_black_board_0_board_temperature
2024-12-31 17:43:41.675 ERROR (MainThread) [homeassistant.components.sensor] Platform miner does not generate unique IDs. ID None-0-chip_temperature already exists - ignoring sensor.nano3_black_board_0_chip_temperature
2024-12-31 17:43:41.675 ERROR (MainThread) [homeassistant.components.sensor] Platform miner does not generate unique IDs. ID None-0-board_hashrate already exists - ignoring sensor.nano3_black_board_0_board_hashrate
2024-12-31 17:43:41.675 ERROR (MainThread) [homeassistant.components.sensor] Platform miner does not generate unique IDs. ID None-0-fan_speed already exists - ignoring sensor.nano3_black_fan_0_fan_speed
2024-12-31 17:43:41.681 DEBUG (MainThread) [custom_components.miner.coordinator] Got data: MinerData(ip='192.168.123.62', datetime='2024-12-31T17:43:41.622568+01:00', timestamp=1735663421, device_info=DeviceInfo(make=<MinerMake.AVALONMINER: 'AvalonMiner'>, model=<AvalonminerModels.AvalonNano3: 'Avalon Nano 3'>, firmware=<MinerFirmware.STOCK: 'Stock'>, algo=SHA256Algo), make='AvalonMiner', model='Avalon Nano 3', firmware='Stock', algo='SHA256', mac=None, api_ver=None, fw_ver='4.11.1', hostname=None, hashrate=3.6752 TH/s, expected_hashrate=4.2 TH/s, expected_hashboards=1, expected_chips=10, expected_fans=1, percent_expected_chips=100, percent_expected_hashrate=88, percent_expected_wattage=None, temperature_avg=90, env_temp=None, wattage=None, wattage_limit=125, voltage=None, fans=[Fan(speed=3990)], fan_psu=None, hashboards=[HashBoard(slot=0, hashrate=3.6752 TH/s, temp=90, chip_temp=93, chips=10, expected_chips=10, serial_number=None, missing=False, tuned=None, active=None, voltage=None)], total_chips=10, nominal=True, config=MinerConfig(pools=PoolConfig(groups=[PoolGroup(pools=[Pool(url='stratum+tcp://stratum.braiins.com:3333', user='XYZ.Nano3-blue', password='x'), Pool(url='stratum+tcp://bch.poolbinance.com:1800', user='XYZ.Nano3-blue', password='x'), Pool(url='stratum+tcp://bch.poolbinance.com:3333', user='XYZ.Nano3-blue', password='x')], quota=1, name='6XCK2Z')]), fan_mode=FanModeNormal(mode='normal', minimum_fans=1, minimum_speed=0), temperature=TemperatureConfig(target=None, hot=None, danger=None), mining_mode=MiningModeNormal(mode='normal')), fault_light=None, errors=[], is_mining=True, uptime=None, efficiency=None, pools=[])
2024-12-31 17:43:41.682 DEBUG (MainThread) [custom_components.miner.coordinator] Finished fetching Nano3 Blue data in 0.299 seconds (success: True)
2024-12-31 17:43:41.684 DEBUG (MainThread) [custom_components.miner.coordinator] Got data: MinerData(ip='192.168.123.62', datetime='2024-12-31T17:43:41.627330+01:00', timestamp=1735663421, device_info=DeviceInfo(make=<MinerMake.AVALONMINER: 'AvalonMiner'>, model=<AvalonminerModels.AvalonNano3: 'Avalon Nano 3'>, firmware=<MinerFirmware.STOCK: 'Stock'>, algo=SHA256Algo), make='AvalonMiner', model='Avalon Nano 3', firmware='Stock', algo='SHA256', mac=None, api_ver=None, fw_ver='4.11.1', hostname=None, hashrate=3.6752 TH/s, expected_hashrate=4.2 TH/s, expected_hashboards=1, expected_chips=10, expected_fans=1, percent_expected_chips=100, percent_expected_hashrate=88, percent_expected_wattage=None, temperature_avg=90, env_temp=None, wattage=None, wattage_limit=125, voltage=None, fans=[Fan(speed=3990)], fan_psu=None, hashboards=[HashBoard(slot=0, hashrate=3.6752 TH/s, temp=90, chip_temp=93, chips=10, expected_chips=10, serial_number=None, missing=False, tuned=None, active=None, voltage=None)], total_chips=10, nominal=True, config=MinerConfig(pools=PoolConfig(groups=[PoolGroup(pools=[Pool(url='stratum+tcp://stratum.braiins.com:3333', user='XYZ.Nano3-blue', password='x'), Pool(url='stratum+tcp://bch.poolbinance.com:1800', user='XYZ.Nano3-blue', password='x'), Pool(url='stratum+tcp://bch.poolbinance.com:3333', user='XYZ.Nano3-blue', password='x')], quota=1, name='E0HAZH')]), fan_mode=FanModeNormal(mode='normal', minimum_fans=1, minimum_speed=0), temperature=TemperatureConfig(target=None, hot=None, danger=None), mining_mode=MiningModeNormal(mode='normal')), fault_light=None, errors=[], is_mining=True, uptime=None, efficiency=None, pools=[])
The text was updated successfully, but these errors were encountered: