Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.
/ FlexpoolInfo Public archive

Provides data from Flexpool.io on a specified miner.

License

Notifications You must be signed in to change notification settings

ThomasPrior/FlexpoolInfo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FlexpoolInfo

hacs_badge

A custom component for HomeAssistant

Provides data from Flexpool.io on a specified miner.

If this has been of use, please consider funding my caffeine habit:

Goals

  • Create sensor items for Flexpool API items:
    • Current statistics

      ✔ Unpaid balance

      ✔ Reported hash rate

      ✔ Average hash rate

      ✔ Current hash rate

      ✔ Valid shares

      ✔ Invalid shares

      ✔ Stale shares

      ✔ Active workers

      ✔ Balance

      ✔ Balance in local currency

    • Payouts

      ✔ Paid on

      ✔ Amount

      ✔ Transaction hash

      ✔ Value in local currency

Things you should know about FlexpoolInfo

  • The Flexpool API is subject to change - there may be occasions where a code change is required before the component will work again.
  • There are limits on how many requests can be made to Flexpool's API and therefore the data retrieved by FlexpoolInfo will be updated periodically and may be out of date by the time you look at it.
  • Please do not use FlexpoolInfo in isolation to make decisions about your cryptocurrency holdings.
  • FlexpoolInfo only reads the statistics of the provided miner.

Pre-requisite knowledge

Before downloading and configuring FlexpoolInfo, please ensure you are familiar with the following items:

  • HomeAssistant's configuration file LINK
  • YAML syntax LINK
  • Installation of custom components via:
    • HACS LINK
    • Manual custom component installation
  • Adding template sensors to your configuration LINK

Installation

Copy the files in the /custom_components/FlexpoolInfo/ folder to: [homeassistant]/config/custom_components/FlexpoolInfo/

HACS users, you know what to do! In case you don't:

  1. Open HACS from your HomeAssistant sidebar
  2. Press the "Explore & Add Repositories"
  3. Enter "FlexpoolInfo" into the search box
  4. Press "FlexoolInfo"
  5. Press "Install this repository in HACS"
  6. Don't forget to complete the configuration before restarting HomeAssistant!

Configuration

To use FlexpoolInfo, please add the following items to your HomeAssistant configuration.yaml

sensor:
  - platform: flexpoolinfo
    miner_address: (required) the address of your Flexpool miner
    currency_name: (required) the currency you would like your unpaid balance to be converted to
    token: (required) ZIL, XCH or ETC
    name_override: (optional) name to identify your wallet instead of your miner address.

Please note that the Ethermine API accepts the address in three formats:

  • ETC: 42 characters beginning with 0x
  • XCH: 62 characters beggining with xch1
  • ZIL: 42 characters beginning with zil1

The address must be encapsulated in quotation marks as follows:

Examples:

sensor:
  - platform: flexpoolinfo
    miner_address: "0x1234567890123456789012345678901234567890"
    currency_name: USD
    token: ETC
sensor:
  - platform: flexpoolinfo
    miner_address: "xch12345678901234567890123456789012345678901234567890123456789"
    currency_name: USD
    token: XCH
sensor:
  - platform: flexpoolinfo
    miner_address: "zil123456789012345678901234567890123456789"
    currency_name: USD
    token: ZIL

Multiple addresses can be configured.

Templates

You can create a template sensor for any of the attributes returned by FlexpoolInfo. For example:

Stale shares: {{ states.sensor.flexpoolinfo_miner_address.attributes['stale_shares'] }}

Current hashrate: {{ states.sensor.flexpoolinfo_miner_address.attributes['current_hashrate'] }}

Unpaid amount: {{ states.sensor.flexpoolinfo_miner_address.attributes['unpaid_balance'] }}

How does it look?

Untitled

Disclaimer: I do not mine cryptocurrency. This screenshot is from a publicly accessible address on Flexpool. Some information has been redacted in the image above to protect the privacy of the individual.

Some rather pretty graphs are possible with the mini-graph-card:

image

Discussion

Talk about FlexpoolInfo here

Post issues with FlexpoolInfo here

Issues should be posted with logs and relevant, redacted excerpts from your configuration.yaml file to ensure that help can be given most effectively.

Pull requests and constructive criticism are always welcome.

Credits

@heyajohnny's CryptoInfo from which this component was born.

W3Schools for being an invaluable learning resource.