Code Monkey home page Code Monkey logo

ha_nicehash's People

Contributors

ivanpavlina avatar romrider avatar sghebuz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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

ha_nicehash's Issues

Power switch not working on QuickMiner

Hi all, I just connected a new rig with QuickMiner NHQM_v0.5.4.3 and I noticed the Power switch doesn't work.
The switch is available in the interface and I can interact with it (not grayed out) but it promptly returns in the previous position if I toggle it.
Is this a known issue or is there a setting I should enable or... it's just my usual luck?

Thanks in advance to anyone willing help me! πŸ˜„

hasrate unavailable

very nice integration. I was able to configure but I'm not receiving the MH/s on my rig. The sensores are there but as unavailable.

I have the API config like the one in the install doc sΓ³ it should have access to this. Anyway I can try to debug this?

thks

Not really an issue - decimal places

Very good integration!
is there a simple way to limit the amount of decimal places?
for example my hashrate is 61.125465859008465 MH/s.
Sorry if dumb question

[Feature Request] Payout to external wallet

Good morning,

Would it be possible to add in a feature that could list the wallets created in NiceHash and some sort of service that would allow us to be able to payout to one of those listed wallets by clicking on a button or calling a service.

Since with your plugin we can view our NiceHash wallet we are able to work out once we have reached the NiceHash min payout threshold and this would basically automate that payout to our preferred external wallet.

Readme Improvement: Improve instructions on enabling integration in Home Assistant

The instructions for how to enable the integration of this custom_component to Home Assistant either no longer work or I am not able to follow it (too vague).

Admittedly I'm very new in the Home Assistant space. I have installed home assistant OS on a Pi 4. I've installed HACS and the custom integration for this custom component.
image

I've verified the custom_component files are in the correct place.
image

Based on the description I should be able to go to "configuration -> integrations" and add the integration there. That should give me a card that I can press configure for and add the details the picture shows. However, I don't seem to be able to find the integration listed under "add integrations".
image

And yes, I have restarted the server at "configuration -> server controls -> server management".

Previous to this, I tried using https://github.com/brianberg/ha-nicehash but it was missing the ability to start/stop rigs, which I see this seems to have. So i attempted to integrate this one in a similar manor by directly altering the configuration.yaml like so, but it doesn't seem to have helped.

# https://github.com/RomRider/ha_nicehash
nicehash:
    name: 'The name'
    key: !secret niceHash_key
    secret: !secret niceHash_secret
    org_id: 'The org ID'
    fiat: 'NZD'

Am I just missing something super obvious here? Maybe the previous install of the brianberg version is interfering?

Feature Request: Start/stop rig

I use my rig as a space heater by mining in the winter. I'd like to be able to automatically start/stop mining based on a temperature sensor. Can you add the ability to start/stop mining with this integration?

Task exception was never retrieved // TypeError: 'NoneType' object is not iterable

First of all:
Big Thank you for the Apex-Chart Cards.... I cannot imagine building a Dashboard without them anymore.
Unfortunately I do not experience the same level of successs with the ha_nicehash integration.

I am trying to use ha_nicehash for a couple of days now and its giving me great troubles, which I came to believe are not my fault :-)
This is a day-0 issue for me (aka it has never worked) so I cannot say if this might be dependent on the Homeassistant Version (I observe this with Home Assistant 2023.3.3 and Home Assistant 2023.3.4 )
I tried to fix my problem myself, but realized that my Programming Skills are by far not good enough to have any chance at it.

Problem:
HA_NiceHash is not updating any of its Entities/Sensors.
When I reload the Integration, or trigger the homeassitant.reload_config_entry service on any of the Entities it succesfully updates the values from nicehash.com.

I tried to workaround the issue, by regularly calling the homeassitant.reload_config_entry from an automation, but that causes a huge memory leak and Homeassistant seizes up in <30 minutes.

If there are any tests, traces or further data you want me to provide, please let me know!

Log Entries:
I found the following Errors in my System Log:
image

I think the Task Exception is what gets thrown, while the regular Update should take place, so probably its worth focusing on that:

This error originated from a custom integration.

Logger: homeassistant
Source: custom_components/nicehash/switch.py:70
Integration: NiceHash (documentation)
First occurred: 08:11:55 (103 occurrences)
Last logged: 09:57:03

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 182, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 330, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 135, in async_update_listeners
    update_callback()
  File "/config/custom_components/nicehash/switch.py", line 70, in _update_entities
    for dev in rig.get("devices"):
TypeError: 'NoneType' object is not iterable

I am not sure if this is a consequence of the Errors that occur during loading the Integration:

Logger: homeassistant.components.switch
Source: custom_components/nicehash/switch.py:70
Integration: Switch (documentation, issues)
First occurred: 08:10:55 (3 occurrences)
Last logged: 09:16:47

Error while setting up nicehash platform for switch
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 293, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/nicehash/switch.py", line 87, in async_setup_entry
    await coordinator.async_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 215, in async_refresh
    await self._async_refresh(log_failures=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 330, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 135, in async_update_listeners
    update_callback()
  File "/config/custom_components/nicehash/switch.py", line 70, in _update_entities
    for dev in rig.get("devices"):
TypeError: 'NoneType' object is not iterable
Logger: homeassistant.components.sensor
Source: custom_components/nicehash/sensor.py:379
Integration: Sensor (documentation, issues)
First occurred: 08:10:55 (3 occurrences)
Last logged: 09:16:47

Error adding entities for domain sensor with platform nicehash
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 442, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 717, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 807, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 559, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 600, in _async_write_ha_state
    state = self._stringify_state(available)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 565, in _stringify_state
    if (state := self.state) is None:
  File "/config/custom_components/nicehash/sensor.py", line 379, in state
    * self.coordinator.data[ACCOUNT_OBJ]["currencies"][0]["fiatRate"]
KeyError: 'fiatRate'
Logger: homeassistant.components.sensor
Source: custom_components/nicehash/switch.py:70
Integration: Sensor (documentation, issues)
First occurred: 08:10:55 (3 occurrences)
Last logged: 09:16:47

Error while setting up nicehash platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 293, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/nicehash/sensor.py", line 120, in async_setup_entry
    await coordinator.async_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 215, in async_refresh
    await self._async_refresh(log_failures=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 330, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 135, in async_update_listeners
    update_callback()
  File "/config/custom_components/nicehash/switch.py", line 70, in _update_entities
    for dev in rig.get("devices"):
TypeError: 'NoneType' object is not iterable

Remove/Cleanup stale rigs

Hi, I've been through a few system rebuilds of multiple rigs that have been offline for ages (some over 6 months)

They no longer appear in NH but are still appearing in the integration.

Is there a way to clean these up? I've gone through and manually cleaned up the entities but the devices are still there.

Feature request: Optimisation switches

It would really nice to be able to change the miners optimisation setting which as far as I know is POWER_MODE in the API.

Idea is to use low when on grid power and high when there's enough solar.

I can try implement but worth a discussion first.

error setting up switch - KeyError: 'fiatRate'

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 231, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/nicehash/switch.py", line 64, in async_setup_entry
    await coordinator.async_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 158, in async_refresh
    await self._async_refresh(log_failures=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 259, in _async_refresh
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 319, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 334, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 368, in _async_write_ha_state
    state = self._stringify_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 340, in _stringify_state
    state = self.state
  File "/config/custom_components/nicehash/sensor.py", line 379, in state
    * self.coordinator.data[ACCOUNT_OBJ]["currencies"][0]["fiatRate"]
KeyError: 'fiatRate'

No Rig Sensors

I installed 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`

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

Problem with sensors unavailable

The problem occurs that sometimes the sensors are unavailable but the mining continues normally, I use this sensor to let me know if the mining stops.

User adjustable SCAN_INTERVAL_MINUTES?

Hey!
Would it be possible to set SCAN_INTERVAL_MINUTES in System options-window? One can always set this manually by editing const.py but for the convenience this would be nice to have this in GUI.

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.