Nicehash Component

Anyone have any interest in a nicehash component along with crypto overview?

Here is what i have so far

6 Likes

nice!
can you share the code for profitability?
I did some tests a month ago but I didn’t succeed to add up all the algos

I don’t have it ready for distribution but i can tell you what i did since nicehash formula blows and i feel that mine is more accurate.

So i use two of their api one to find out when the last mining payment occurred, this then is the timestamp to check against current balance for the day.

So it goes something like this

Current Time - Time Last Mining Payment from NH = Total Time Mining that is reflective of the unpaid mining balance reported by their api.

I then interval it by minutes of the Total Time Mining. So lets say NH paid us at 6am and i am checking profitability at 7am and i have a balance of .004 BTC

That would be 60 minutes of mining

,004 / 60 = profit per minute

from that you can then calculate any forward metric.

hopefully that makes sense to you. I just got this up and running this week so i plan to let it run for a couple weeks and then making it more modular and getting it to git. Right now i am using the command_line component to run two scripts that handle the api requests in php. Gotta port it to python and custom component

I didn’t manage to make it work unfortunately
is your code ready for distribution?

Not much of a python coder, so i wrote it in php and i just use command line sensors for it. If you think you could swing it i can give you the code and you can play with it. I will probably convert it to a py component when i get some time. hard to justify when its working as is :slight_smile:

Would like to have this… have a little project of my own where my mining rig boots up when my solar panels are generating more power than the house needs… this would be an awesome addition :smiley:

2 Likes

I realise this post is over a year old now, but i’d love to have this on my hassio install. How would i go about installing this?

Did you get anywhere with this? If not can you share you init api code so we can fork it?

3 Likes

I need this

I’ve built something, feel free to test it :slight_smile:
Have fun: https://github.com/RomRider/ha_nicehash

6 Likes

Cool! Thanks for sharing, will take a look.

Great it works. Is it possible to start and stop mining from the API? I would like to calculate when its not profitable and pause the miner

I’ve implemented it but right now the API is down so can’t test it :smiley:

This is awesome and working well!

For the future, recommend implementing switches for turning mining on and off. Thanks for the great work!

@aleksander.lyse and @pearlythepirate, switches are released. It might be a bit glitchy if the delay between the switch is toggled and the action really happens is too long (That’s because sometimes it takes time for NiceHash to send the command to your rig)

Hi @RomRider thanks for the integration.

I’m trying to set it up and test, and I can’t seem to determine what the organisation ID should be or where I can determine it. Got everything setup using HACS as far as I can tell, just trying to setup the final step.

When I submit my details, I get an error “Failed to connect”.
Can you indicate what the Org ID means?

Thanks.

Nevermind, I’m an idiot, missed it on the API page.
Thanks for making this.

Switch works great!! Thanks for adding it.

I have an automation set up that detects if I am on my PC gaming and then automatically turns off mining. It turns it back on again to keep making money when I’m done!

1 Like

It should be noted that NiceHashMiner already does this in its own app settings.

The local miner app can detect usage using windows hooks (Same way screensaver works) and has thresholds for delays and such.

Not saying you can’t or shouldn’t, just stating in case anyone reading is wondering if this is strictly necessary for this functionality. :+1:

For my knowledge, are you using IOT Link to detect things running on your computer? If not, what else are you using?