Coder Social home page Coder Social logo

flexpoolinfo's Introduction

Hi there ๐Ÿ‘‹

flexpoolinfo's People

Contributors

savagecore avatar thomasprior avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

savagecore

flexpoolinfo's Issues

KeyError: 'ethereum' error in logs

Describe the issue
Seeing this error occasionally in my logs

To Reproduce

2022-08-31 09:54:31.830 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.flexpoolinfo_0x880668a8c1495d490xxxxxxxxxxx fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 514, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 709, in async_device_update
    raise exc
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 192, in wrapper
    result = method(*args, **kwargs)
  File "/config/custom_components/flexpoolinfo/sensor.py", line 249, in _update
    if len(r5.json()['ethereum']):
KeyError: 'ethereum'

Expected behaviour
Not throw exceptions :)

Configuration

  • platform: flexpoolinfo
    miner_address: "0x880668A8c1495D49xxxxxxxxxxxxxxxsx"
    currency_name: "USD"
    token: ETH

Environment (please complete the following information):

Home Assistant 2022.8.7
Supervisor 2022.08.5
Operating System 8.5
Frontend 20220802.0 - latest

After the last update it stopped working 2022.4.1

Describe the issue
I stop fetching data from flexpool

Configuration

  • platform: flexpoolinfo
    miner_address: '0x6450d31Bb967771F8278D80e5ed6299942508c7e'
    currency_name: USD
    token: eth

  • platform: template
    sensors:
    minado_flexpool:
    friendly_name: "Minado Flexpool"
    unit_of_measurement: "ETH"
    value_template: "{{ '%0.0f' | format(((states.sensor.flexpoolinfo_0x6450d31bb967771f8278d80e5ed6299942508c7e.attributes['unpaid_balance']/1000000000000 | float)) | round(0)) | int / 1000000 }}"

  • platform: template
    sensors:
    minado_flexpool_usd:
    friendly_name: "Minado Flexpool USD"
    unit_of_measurement: "USD"
    value_template: "{{ '%.2f' | format(states('sensor.minado_flexpool') | float * states('sensor.eth_exchange_rate')| float) | round(2) }}"

  • platform: template
    sensors:
    shares_flexpool:
    friendly_name: "Shares Flexpool"
    value_template: "{{ (states.sensor.flexpoolinfo_0x6450d31bb967771f8278d80e5ed6299942508c7e.attributes['valid_shares'] | float | round(0)) }}"

  • platform: template
    sensors:
    shares_stale_flexpool:
    friendly_name: "Shares Stale Flexpool"
    value_template: "{{ (states.sensor.flexpoolinfo_0x6450d31bb967771f8278d80e5ed6299942508c7e.attributes['stale_shares'] | float | round(0)) }}"

  • platform: template
    sensors:
    shares_invalid_flexpool:
    friendly_name: "Shares Invalid Flexpool"
    value_template: "{{ (states.sensor.flexpoolinfo_0x6450d31bb967771f8278d80e5ed6299942508c7e.attributes['invalid_shares'] | float | round(0)) }}"

  • platform: template
    sensors:
    hashrate_current_effective_flexpool:
    friendly_name: "Current Effective Flexpool"
    value_template: "{{ '%0.2f' | format((states.sensor.flexpoolinfo_0x6450d31bb967771f8278d80e5ed6299942508c7e.attributes['current_hashrate']/1000000 | float) | round(1)) }}"

  • platform: template
    sensors:
    hashrate_average_effective_flexpool:
    friendly_name: "Average Effective Flexpool"
    value_template: "{{ '%0.2f' | format((states.sensor.flexpoolinfo_0x6450d31bb967771f8278d80e5ed6299942508c7e.attributes['average_hashrate']/1000000 | float) | round(1)) }}"

  • platform: template
    sensors:
    hashrate_reported_hashrate_flexpool:
    friendly_name: "Reported Hashrate Flexpool"
    value_template: "{{ '%0.2f' | format((states.sensor.flexpoolinfo_0x6450d31bb967771f8278d80e5ed6299942508c7e.attributes['reported_hashrate']/1000000 | float) | round(1)) }}"

Environment (please complete the following information):
No errors seen within the Homeassistant log

Thank you so much for everything

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.