Skip to content
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

Additional Status (Braiins / Bosminer) Tuner & Pool #346

Open
Dukat-Gul opened this issue Mar 23, 2024 · 1 comment
Open

Additional Status (Braiins / Bosminer) Tuner & Pool #346

Dukat-Gul opened this issue Mar 23, 2024 · 1 comment

Comments

@Dukat-Gul
Copy link

Dukat-Gul commented Mar 23, 2024

Describe the solution you'd like
It would be nice to see in Home Assistant along side each of the respectively hash cards other details like the Tuner Status. perhaps Pool status

Describe alternatives you've considered
I believe the option is available in pyasic

new versions of BraiinsOS+ (post-gRPC)
Source code pyasic/miners/backends/braiins_os.py

if rpc_tunerstatus is not None:
            errors = []
            try:
                chain_status = rpc_tunerstatus["TUNERSTATUS"][0]["TunerChainStatus"]
                if chain_status and len(chain_status) > 0:
                    offset = (
                        6 if int(chain_status[0]["HashchainIndex"]) in [6, 7, 8] else 0
                    )

                    for board in chain_status:
                        _id = board["HashchainIndex"] - offset
                        if board["Status"] not in [
                            "Stable",
                            "Testing performance profile",
                            "Tuning individual chips",
                        ]:
                            _error = board["Status"].split(" {")[0]
                            _error = _error[0].lower() + _error[1:]
                            errors.append(BraiinsOSError(f"Slot {_id} {_error}"))
                return errors

old versions of BraiinsOS+ (pre-gRPC)

Source code in pyasic/miners/backends/braiins_os.py

if rpc_tunerstatus is not None:
            errors = []
            try:
                chain_status = rpc_tunerstatus["TUNERSTATUS"][0]["TunerChainStatus"]
                if chain_status and len(chain_status) > 0:
                    offset = (
                        6 if int(chain_status[0]["HashchainIndex"]) in [6, 7, 8] else 0
                    )

                    for board in chain_status:
                        _id = board["HashchainIndex"] - offset
                        if board["Status"] not in [
                            "Stable",
                            "Testing performance profile",
                            "Tuning individual chips",
                        ]:
                            _error = board["Status"].split(" {")[0]
                            _error = _error[0].lower() + _error[1:]
                            errors.append(BraiinsOSError(f"Slot {_id} {_error}"))
                return errors

linux cli.

echo -n "stats" | nc IP_OF_MINER_GOES_HERE 4028
and

echo -n "pools" | nc IP_OF_MINER_GOES_HERE 4028

Additional context
Thanks. Really enjoy being able to automate with the currently available triggers. Great granular options would be enabled with some additional visibility.

@b-rowan
Copy link
Collaborator

b-rowan commented Mar 23, 2024

Yep, errors are available via pyasic by default, and are in the call that we are using. Here's the list of available data for reference - https://docs.pyasic.org/en/latest/data/miner_data/

The biggest issue with this is that I'm not sure the best way to display text based data on the HASS interface. You can imagine that it could get clunky, and it's not feasible to create separate entities for each "error" as they happen. I would love to understand why you want the error codes in this case, as I believe it would be much easier to automate something based off board hashrate which is already available, but there may be a use case I'm missing here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants