-
Notifications
You must be signed in to change notification settings - Fork 19
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
Cannot power on/off Antminer S19k Pro from HA #369
Comments
Should be fixed with the latest version I think, try it out. |
Thanks for the reply! Logger: homeassistant.setup Setup failed for custom integration 'miner': Requirements for miner not found: ['pyasic==0.60.5']. Any tips? |
Yeah, apparently my pyasic version didn't release, it should be fixed now. |
This is a bit more of a complicated issue than just "failing to turn off", and I would prefer to move it to a separate issue. I will however, attempt to explain it. pyasic (the miner control backend used) does not persist initial state when updating a config, nor does hass-miner. This means that when you put the miner into sleep mode, it doesn't know what state to revert it to. The default functions for "on" and "off" for antminers on stock are "normal" and "sleep" respectively, meaning it will always revert to "normal" mode by default. If you were to use aftermarket firmware (BOS+ works the best with this integration, and they have a contiguous tuner mechanism), you can set the power limit there and it will persist through on/off cycles, because there is a seperate "pause" and "resume" command for the firmware, which does not change the configuration. |
I added a select switch (which I can't test) for power mode in |
Even better, I tried a proper fix for this (where the switch entity stores the last mining mode state, since I'm now pulling config) in v1.1.19rc3. It is likely even less stable than rc2, but worth a shot if you want to try it. |
Wow, I truly appreciate your help. Honestly, I thought you might have forgotten about me a long time ago. Hats off to you—this is what I call first-class support! I can’t test it right away since Bitcoin is on its way to $100k, so I’m keeping the miner running 24/7 for now. :) But I’ll make sure to test this as soon as possible and share my feedback with you. Once again, thank you so much! |
No problem man, I just get busy sometimes and don't have time to sit down and work on this stuff. Hopefully this works for you. You are welcome to update and just see if the selector even shows up for you, like I said, it might not be very stable... |
Ah, yeah that's not supposed to be the case. Looks like I'm going to have to do some more looking... |
Version of the custom_component
hass-miner: v1.1.13
Type Miner: Antminer S19k Pro
Firmware Version Miner Tue Apr 9 11:41:24 CST 2024
Configuration
Describe the bug
Cannot powrer on/off miner from HomeAssistant
Debug log
2024-08-29 11:57:29.882 DEBUG (MainThread) [custom_components.miner.coordinator] Found miner: S19K Pro (Stock): 10.12.222.20
2024-08-29 11:57:30.103 DEBUG (MainThread) [custom_components.miner.coordinator] Got data: MinerData(ip='10.12.222.20', datetime='2024-08-29T11:57:29.883099+02:00', timestamp=1724925449, device_info=DeviceInfo(make=<MinerMake.ANTMINER: 'AntMiner'>, model=<AntminerModels.S19KPro: 'S19K Pro'>, firmware=<MinerFirmware.STOCK: 'Stock'>, algo=SHA256Algo), make='AntMiner', model='S19K Pro', firmware='Stock', algo='SHA256', mac='16:77:C1:EB:D9:29', api_ver=None, fw_ver='Tue Apr 9 11:41:24 CST 2024', hostname='Antminer', hashrate=124.2888 TH/s, expected_hashrate=120.0 TH/s, expected_hashboards=3, expected_chips=231, expected_fans=4, percent_expected_chips=100, percent_expected_hashrate=104, percent_expected_wattage=None, temperature_avg=52, env_temp=None, wattage=None, wattage_limit=None, voltage=None, fans=[Fan(speed=4760), Fan(speed=4710), Fan(speed=4330), Fan(speed=4350)], fan_psu=None, hashboards=[HashBoard(slot=0, hashrate=42.397169999999996 TH/s, temp=51.5, chip_temp=56.5, chips=77, expected_chips=77, serial_number='JYZZYRNBDJAAA0JJ2', missing=False, tuned=None, active=None, voltage=None), HashBoard(slot=1, hashrate=40.65994 TH/s, temp=52.0, chip_temp=57.0, chips=77, expected_chips=77, serial_number='JYZZYRNBDJAAA0HM1', missing=False, tuned=None, active=None, voltage=None), HashBoard(slot=2, hashrate=41.23169 TH/s, temp=52.5, chip_temp=57.5, chips=77, expected_chips=77, serial_number='JYZZYRNBDJAAA0N9T', missing=False, tuned=None, active=None, voltage=None)], total_chips=231, nominal=True, config=None, fault_light=None, errors=[], is_mining=True, uptime=None, efficiency=None, pools=[])
2024-08-29 11:57:30.104 DEBUG (MainThread) [custom_components.miner.coordinator] Finished fetching S19Pro data in 0.233 seconds (success: True)
2024-08-29 11:57:34.883 DEBUG (MainThread) [custom_components.miner.switch] S19Pro: Stop mining.
2024-08-29 11:57:39.885 DEBUG (MainThread) [custom_components.miner.coordinator] Found miner: S19K Pro (Stock): 10.12.222.20
2024-08-29 11:57:40.169 DEBUG (MainThread) [custom_components.miner.coordinator] Got data: MinerData(ip='10.12.222.20', datetime='2024-08-29T11:57:39.885542+02:00', timestamp=1724925459, device_info=DeviceInfo(make=<MinerMake.ANTMINER: 'AntMiner'>, model=<AntminerModels.S19KPro: 'S19K Pro'>, firmware=<MinerFirmware.STOCK: 'Stock'>, algo=SHA256Algo), make='AntMiner', model='S19K Pro', firmware='Stock', algo='SHA256', mac='16:77:C1:EB:D9:29', api_ver=None, fw_ver='Tue Apr 9 11:41:24 CST 2024', hostname='Antminer', hashrate=125.45427000000001 TH/s, expected_hashrate=120.0 TH/s, expected_hashboards=3, expected_chips=231, expected_fans=4, percent_expected_chips=100, percent_expected_hashrate=105, percent_expected_wattage=None, temperature_avg=52, env_temp=None, wattage=None, wattage_limit=None, voltage=None, fans=[Fan(speed=4750), Fan(speed=4730), Fan(speed=4360), Fan(speed=4340)], fan_psu=None, hashboards=[HashBoard(slot=0, hashrate=41.6495 TH/s, temp=51.5, chip_temp=56.5, chips=77, expected_chips=77, serial_number='JYZZYRNBDJAAA0JJ2', missing=False, tuned=None, active=None, voltage=None), HashBoard(slot=1, hashrate=42.00134 TH/s, temp=52.0, chip_temp=57.0, chips=77, expected_chips=77, serial_number='JYZZYRNBDJAAA0HM1', missing=False, tuned=None, active=None, voltage=None), HashBoard(slot=2, hashrate=41.80343 TH/s, temp=52.5, chip_temp=57.5, chips=77, expected_chips=77, serial_number='JYZZYRNBDJAAA0N9T', missing=False, tuned=None, active=None, voltage=None)], total_chips=231, nominal=True, config=None, fault_light=None, errors=[], is_mining=True, uptime=None, efficiency=None, pools=[])
2024-08-29 11:57:40.169 DEBUG (MainThread) [custom_components.miner.coordinator] Finished fetching S19Pro data in 0.298 seconds (success: True)
The text was updated successfully, but these errors were encountered: