thomasprior / flexpoolinfo Goto Github PK
View Code? Open in Web Editor NEWProvides data from Flexpool.io on a specified miner.
License: GNU General Public License v3.0
Provides data from Flexpool.io on a specified miner.
License: GNU General Public License v3.0
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
Environment (please complete the following information):
Home Assistant 2022.8.7
Supervisor 2022.08.5
Operating System 8.5
Frontend 20220802.0 - latest
For example:
Home Assistant is unable to find the integration using the example config. Please change the examples to the following instead:
sensor:
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.