Giter Site home page Giter Site logo

ha-nicehash's Introduction

NiceHash Home Assistant Integration

GitHub Release License

hacs Project Maintenance BuyMeCoffee

Discord Community Forum

A Home Assistant integration that creates a collection of NiceHash account balance, rig, and individual device sensors.

Preview

Available Sensors

  • Account Balances (BTC and USD/EUR)
    • Total
    • Pending
    • Available
  • Rigs
    • Status
    • Temperature
    • Profitability
  • Devices
    • Status
    • Algorithm
    • Speed
    • Temperature
    • Load
    • RPM
  • Most Recent Mining Payout

None of the sensors are added by default. See installation instructions for available configuration options.

Installation

Prerequisites

These instructions assume you have a NiceHash account and an API key.

Supported API permissions and associated sensors

  • Wallet Permissions > View balances...
    • Account balance sensors
  • Mining Permissions > View mining data...
    • Rig, device, and payout sensors

See this repository for further assistance generating an API key.

HACS (recommended)

  1. Open HACS > Integrations
  2. Add https://github.com/brianberg/ha-nicehash as a custom repository as Category: Integration
  3. Click install under "NiceHash" in the Integrations tab
  4. Add nicehash to configuration.yaml
    nicehash:
      organization_id: # <org_id>
      api_key: # <api_key_code>
      api_secret: #<api_secret_key_code>
      currency: EUR # (default = USD)
      balances: true # (default = false) - Enable balance sensors
      rigs: true # (default = false) - Enable rig sensors
      devices: true # (default = false) - Enable device sensors
      payouts: true # (default = false) - Enable payout sensors
    
  5. Restart Home Assistant

Manual

  1. Using the tool of choice open the directory (folder) for your HA configuration (where you find configuration.yaml).
  2. If you do not have a custom_components directory (folder) there, you need to create it.
  3. In the custom_components directory (folder) create a new folder called nicehash.
  4. Download all the files from the custom_components/nicehash/ directory (folder) in this repository.
  5. Place the files you downloaded in the new directory (folder) you created.
  6. Add nicehash to configuration.yaml
    nicehash:
      organization_id: # <org_id>
      api_key: # <api_key_code>
      api_secret: #<api_secret_key_code>
      currency: EUR # (default = USD)
      balances: true # (default = false) - Enable balance sensors
      rigs: true # (default = false) - Enable rig sensors
      devices: true # (default = false) - Enable device sensors
      payouts: true # (default = false) - Enable payout sensors
    
  7. Restart Home Assistant

Contributions are welcome!

If you want to contribute to this please read the Contribution guidelines

ha-nicehash's People

Contributors

brianberg avatar fufar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ha-nicehash's Issues

strangly shows temp of video

Version of the custom_component

72543f6 ? latest

Configuration

2021.5.3, docker, debian

Describe the bug

A clear and concise description of what the bug is.
image
image
This is not my gpu temp. This is sun temp or whatever :)

I have only 1 gpu so cant say - it is problem for one or all

Component error: nicehash - Integration 'nicehash' not found.

Got the Errormessage: Component error: nicehash - Integration 'nicehash' not found. after updating to Home Assistant 2021.6.0
Sensors dont work anymore and marked as 'unavailable'.

Logger: homeassistant.setup
Source: setup.py:172
First occurred: 9:57:41 (1 occurrences)
Last logged: 9:57:41

Setup failed for nicehash: Integration not found.

Switch for turn on and off mining

I seen the option in RomRider developer he added the switch to make the mining turn on or off remotely.

I installed your's and romrider both integration in hacs in my HA but seems one works at a time. so i renamed the RomRider repository as nicehash1 and successfully installed but the domain is same to retrieve info so only one work at a time. i cant able to make them work simultaneously. only done integration works. I added his integration becoz of the only reason of switch and also have the data of accepted and rejected hashrate info. so kindly add these three options in your repository . or is there any way make work both of them. Thanks in advance. sorry for my bad English though.

No Rig Sensors

After enabling and configuring, I don't get any sensors for Rigs or Devices. I only get account balance sensors.

I installed the latest version of this via hacs and am only getting sensors for account balances and mining payout.

My config has these options enabled:

`currency: CAD

balances: true

rigs: true

devices: true

payouts: true`

I'm running home assistant: core-2021.6.1

No errors are in the logs either. I have all mining permissions enabled as well.

alternative currencies were previously supported... weren't they?

I had the configuration working fine, upgraded to latest and now I can't view my sensors in CAD currency. This suggests to me that the only thing preventing alternative currencies is a check in the python of this plugin? Can you add support for additional currencies?
https://github.com/brianberg/ha-nicehash/blob/master/custom_components/nicehash/sensor.py#L124

Am I crazy to think it worked before? I checked the history on the code and didn't see any recent changes to it...

Version of the custom_component

72543f6

Configuration

nicehash:
  organization_id: !secret nicehash_id
  api_key: !secret nicehash_key
  api_secret: !secret nicehash_secret
  currency: CAD # (default = USD)
  balances: true # (default = false) - Enable balance sensors
  rigs: true # (default = false) - Enable rig sensors
  devices: false # (default = false) - Enable device sensors
  payouts: false # (default = false) - Enable payout sensors

Describe the bug

Should be able to support any currency that nicehash also supports.

Debug log


Logger: custom_components.nicehash.sensor
Source: custom_components/nicehash/sensor.py:151
Integration: NiceHash (documentation, issues)
First occurred: 10:48:29 (1 occurrences)
Last logged: 10:48:29

Invalid currency: must be EUR or USD

Error during setup of component nicehash

Version of the custom_component

0.1.1

Configuration

nicehash:
organization_id: # <org_id>
api_key: # <api_key_code>
api_secret: #<api_secret_key_code>
currency: EUR # (default = USD)
balances: true # (default = false) -
rigs: true # (default = false) -
devices: true # (default = false) -
payouts: true # (default = false) -

Error during setup of component nicehash
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 255, in _async_setup_component
result = await task
File "/config/custom_components/nicehash/init.py", line 63, in async_setup
nicehash_config = config[DOMAIN]
KeyError: 'nicehash'

Describe the bug

After the installation via HACS, after the reboot i get the error above

Debug log

2021-09-06 16:27:45 ERROR (MainThread) [homeassistant.setup] Error during setup of component nicehash
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 255, in _async_setup_component
result = await task
File "/config/custom_components/nicehash/init.py", line 63, in async_setup
nicehash_config = config[DOMAIN]
KeyError: 'nicehash'

Ability to enable and disable mining

Is there some way to include enabling and disabling mining. Im trying to enable an automation that will turn on and off the miner on my PC depending on if I am generating excess electricity from my solar panels.

Missing version key in manifest

When starting Home Assistant (2021.5.1) I get the following in the Core Log:

2021-05-12 20:36:30 ERROR (MainThread) [homeassistant.loader] No 'version' key in the manifest file for custom integration 'nicehash'. As of Home Assistant 2021.6, this integration will no longer be loaded. Please report this to the maintainer of 'nicehash'

VRAM temp readings

Describe the solution you'd like
Can we get temperature readings for the GPU VRAM? I've been searching for a way to automate my fans to turn on when my VRAM gets too hot.

homeassistant.exceptions.PlatformNotReady

**Invalid config
The following integrations and platforms could not be set up:

nicehash
Please check your config and logs.**

Version of the custom_component

Configuration

Default Yaml with my API key...

Add your logs here.

Describe the bug

Does not work at all

Debug log

2021-02-05 16:23:05 DEBUG (MainThread) [custom_components.nicehash.coordinators] Finished fetching nicehash_mining_payouts_coordinator data in 8.149 seconds
2021-02-05 16:23:05 ERROR (MainThread) [custom_components.nicehash] Unable to get NiceHash mining payouts
2021-02-05 16:23:05 ERROR (MainThread) [homeassistant.setup] Error during setup of component nicehash
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 213, in _async_setup_component
    result = await task
  File "/config/custom_components/nicehash/__init__.py", line 105, in async_setup
    raise PlatformNotReady
homeassistant.exceptions.PlatformNotReady

Add your logs here.

Error fetching nicehash_accounts_coordinator data: 'Response' object has no attribute 'reason'

HASS core-2021.8.4

Configuration

nicehash:
organization_id: elishome
api_key: ******************
api_secret: ***************
currency: EUR
balances: true # (default = false) - Enable balance sensors
rigs: true # (default = false) - Enable rig sensors
devices: true # (default = false) - Enable device sensors
payouts: true # (default = false) - Enable payout sensors`

Debug log

2021-08-09 14:27:00 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry UPnP/IGD for upnp
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 293, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/usr/src/homeassistant/homeassistant/components/upnp/init.py", line 90, in async_setup_entry
udn = entry.data[CONFIG_ENTRY_UDN]
KeyError: 'udn'
2021-08-09 14:27:00 ERROR (MainThread) [custom_components.nicehash.coordinators] Error fetching nicehash_accounts_coordinator data: 'Response' object has no attribute 'reason'
2021-08-09 14:27:00 ERROR (MainThread) [custom_components.nicehash] Unable to get NiceHash accounts
2021-08-09 14:27:00 ERROR (MainThread) [homeassistant.setup] Error during setup of component nicehash
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 249, in _async_setup_component
result = await task
File "/config/custom_components/nicehash/init.py", line 93, in async_setup
raise PlatformNotReady
homeassistant.exceptions.PlatformNotReady: None

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.