Scrape Web data value

Hi,

I want to scrape a value from a web site, but I can’t.
That’s the code:

  - platform: scrape
    name: "Average MH/s"
    resource: "https://ethermine.org/miners/9cfbe741de5f26c5433472c069f7ed9138b84749/dashboard"
    select: "#app > main > div > div.miner-content > div > div:nth-child(2) > div.dashboard-overview > div.charts > div.hashrate > div > div:nth-child(3) > div > div.stat-card-body > span:nth-child(1)"
    unit_of_measurement: "MH/s"

But does not work, the value of the sensor it is “unknown”

Can anyone help me with that? Thanks!

Did you find any solution to this?

Hello! If you’re looking for data from Ethermine, would you consider using a custom component I’ve developed for it?

You look like an ideal tester as you seem to have quite the mining setup!

1 Like

Hey @thomasprior, I ve been using your component for a couple of days now.

It’s working great so far.

Any chance we could get the estimates for daily eth production imported?

I ve been trying to make a db sensor to give me an estimate of the eth difference (1h, 6h, 12h, 24h) but I can’t seem to be able to… (I also tried statistics sensor without luck. Next is utility meter sensor)

Also, why do you need a currency input in the config since the currency estimates are not implemented yet? I don’t get it.

I’m working on a dashboard with a lot of info, I’m currently trying to implement hive OS api statistics into it.

I’ll happily share it once it’s done :slight_smile:

Again, thanks for the component

If it’s in the API I can try to get it added this weekend.

As for the local currency conversion, it’s something I have been planning to implement since day 1 but haven’t actually finished. The perils of adult life, eh?

I don’t think it’s in the api as is.

But the api does offer some sets of older data doesn’t it?
Maybe it could be extracted through that?

Or have the option to enable extra sensors that would report historical data?

I don’t know, you are the expert :slight_smile:

Heheheh

Yeah I was wondering why you were requiring a currency, my best bet was that it would be implemented soon, as you said. Just thought I’d ask.

Thanks again!

I’m not comfortable creating metrics myself that would otherwise affect others interpretation of the data. That said, in the dev branch I’ve enabled the coinsPerMin attribute from the API which is described as follows:

“Estimated number of coins mined per minute (based on your average hashrate as well as the average”

Based on this data, you could extrapolate out to 1h, 6h, 12h and 24h by creating a template sensor for each, and then you can use that sensor however you’d like.

Would this get you closer to what you need?

Edit: also the currency conversion stuff is in the dev branch too! If you feel like testing it, please grab the files from the branch and let me know if you encounter any issues. Thanks for using my code!

Thank you very much, it works perfectly! Now I have all the data I need on HA :smiley:

1 Like