Code Monkey home page Code Monkey logo

ethermineinfo's Issues

Sensor does not seem to get data

Hey, it's me from the home assistant forum. I collected the following logs:

Logger: homeassistant.helpers.entity
Source: custom_components/ethermineinfo/sensor.py:124
Integration: ethermineinfo (documentation, issues)
First occurred: 23:16:10 (1 occurrences)
Last logged: 23:16:10

Update for sensor.ethermineinfo_83984_____________________________________________113 fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 316, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 524, in async_device_update
raise exc
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/util/init.py", line 280, in wrapper
result = method(*args, **kwargs)
File "/config/custom_components/ethermineinfo/sensor.py", line 124, in _update
self._state = r.json()['data']['currentStatistics']['activeWorkers']
KeyError: 'data'

I hope this will help solving the problem.

Greetings,

Entity sensor.ethermineinfo_eth (<class 'custom_components.ethermineinfo.sensor.EthermineInfoSensor'>) implements device_state_attributes. Please report it to the custom component author.

Logger: homeassistant.helpers.entity
Source: helpers/entity.py:549
First occurred: 09:46:41 (1 occurrences)
Last logged: 09:46:41

Entity sensor.ethermineinfo_eth (<class 'custom_components.ethermineinfo.sensor.EthermineInfoSensor'>) implements device_state_attributes. Please report it to the custom component author.

System Health

version: core-2021.12.6
installation_type: Home Assistant OS
dev: false
hassio: true
docker: true
user: root
virtualenv: false
python_version: 3.9.7
os_name: Linux
os_version: 5.10.83
arch: x86_64
timezone: Asia/Shanghai

GitHub API: ok
Github API Calls Remaining: 4885
Installed Version: 1.18.0
Stage: running
Available Repositories: 932
Installed Repositories: 15

logged_in: false
can_reach_cert_server: ok
can_reach_cloud_auth: ok
can_reach_cloud: ok

host_os: Home Assistant OS 7.0
update_channel: stable
supervisor_version: supervisor-2021.12.2
docker_version: 20.10.9
disk_total: 30.8 GB
disk_used: 18.1 GB
healthy: true
supported: true
board: ova
supervisor_api: ok
version_api: ok
installed_addons: File editor (5.3.3), Mosquitto broker (6.0.1), Terminal & SSH (9.2.2), RPC Shutdown (2.2), Node-RED (9.2.1), Samba share (9.5.1), ESPHome (1.20.3), Duck DNS (1.14.0), InfluxDB (4.3.0), Nginx Proxy Manager (0.11.0)

dashboards: 1
resources: 6
views: 3
mode: storage

[ISSUE] Fails if all workers are offline

  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 487, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 691, in async_device_update
    raise exc
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 195, in wrapper
    result = method(*args, **kwargs)
  File "/config/custom_components/ethermineinfo/sensor.py", line 190, in _update
    self._state = r.json()['data']['currentStatistics']['activeWorkers']
KeyError: 'activeWorkers'```

After updating to 1.0.0, the sensor fails to update if local_currency is specified

Describe the issue
The sensor fails to update if the currency_name parameter is specified

To Reproduce
Steps to reproduce the behavior:

  1. Configure the sensor like in the example
  2. Restart HA to apply the new config
  3. Observe the sensor not updating and this in the log:
2021-05-21 18:53:48 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.ethermineinfo_metamask fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 316, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 524, in async_device_update
    raise exc
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 280, in wrapper
    result = method(*args, **kwargs)
  File "/config/custom_components/ethermineinfo/sensor.py", line 212, in _update
    self._single_coin_in_local_currency = r4.json()['ethereum'][self.local_currency]
KeyError: 'USD'
  1. Removing the parameter and restarting HA fixes the sensor

Expected behaviour
Sensor updates correctly, no exceptions in the log

Configuration

  - platform: ethermineinfo
    miner_address: "0x..."
    currency_name: USD
    name_override: "Metamask"

Environment (please complete the following information):

System Health

version core-2021.5.5
installation_type Home Assistant Container
dev false
hassio false
docker true
virtualenv false
python_version 3.8.9
os_name Linux
os_version 5.4.0-62-generic
arch x86_64
timezone Europe/Moscow
Home Assistant Community Store
GitHub API ok
Github API Calls Remaining 4642
Installed Version 1.12.3
Stage running
Available Repositories 825
Installed Repositories 26
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Lovelace
dashboards 1
resources 10
views 6
mode storage

Additional context
Add any other context about the problem here.

[ISSUE]

Describe the issue
A clear and concise description of what the issue is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behaviour
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Configuration

Environment (please complete the following information):

Additional context
Add any other context about the problem here.

[ISSUE] It do not work again after 12-30-2021

Describe the issue
All sensor of the integration are in "unknown" state

This is what the log says:

`Este error se originó a partir de una integración personalizada.

Logger: homeassistant.helpers.entity
Source: custom_components/ethermineinfo/sensor.py:190
Integration: ethermineinfo (documentation, issues)
First occurred: 23:38:00 (7 occurrences)
Last logged: 23:41:26

Update for sensor.ethermineinfo_ethermine_alsaje fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 487, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 691, in async_device_update
raise exc
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/util/init.py", line 195, in wrapper
result = method(*args, **kwargs)
File "/config/custom_components/ethermineinfo/sensor.py", line 190, in _update
self._state = r.json()['data']['currentStatistics']['activeWorkers']
KeyError: 'activeWorkers'`

This is in my sensors.yaml
- platform: ethermineinfo miner_address: "0xa2fF046A6346f686Ba8Cf77C28706F4319600613" currency_name: EUR name_override: "Ethermine Alsaje"

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.