Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emoncms Integration - Null value causes error #38016

Closed
borpin opened this issue Jul 20, 2020 · 13 comments
Closed

Emoncms Integration - Null value causes error #38016

borpin opened this issue Jul 20, 2020 · 13 comments

Comments

@borpin
Copy link

borpin commented Jul 20, 2020

The problem

A user reported seeing this error on the OEM Forum.

On checking they discovered that one of the Feeds had a Null value. When removed the error stopped.

Tested myself to confirm.

The code should check for a valid value before converting.

Environment

  • Home Assistant Core release with the issue: 0.112.4
  • Last working Home Assistant Core release (if known):
  • Operating environment (OS/Container/Supervised/Core): Supervised
  • Integration causing this issue: Emoncms
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/emoncms/

Problem-relevant configuration.yaml

sensor:
  platform: emoncms
  api_key: API_KEY
  url: 192.168.1.10
  id: 1

Traceback/Error logs

File "/usr/src/homeassistant/homeassistant/components/emoncms/sensor.py", line 160, in __init__
self._state = round(float(elem["value"]), DECIMALS)
TypeError: float() argument must be a string or a number, not 'NoneType'

Additional information

else:
self._state = round(float(elem["value"]), DECIMALS)

A check is needed to ensure the elem["value"] is valid and set sensor as unavailable if not.

My Python is not good enough to know what should be done to avoid this error being generated.

@probot-home-assistant
Copy link

emoncms documentation
emoncms source
(message by IssueLinks)

@github-actions
Copy link

github-actions bot commented Nov 9, 2020

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Nov 9, 2020
@borpin
Copy link
Author

borpin commented Nov 9, 2020

Could I get a small amount of help with this please?

@github-actions github-actions bot removed the stale label Nov 9, 2020
@github-actions
Copy link

github-actions bot commented Feb 7, 2021

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Feb 7, 2021
@borpin
Copy link
Author

borpin commented Feb 8, 2021

I still need some help to fix this error please. Just needs a check added that the value exists/is valid.

@github-actions github-actions bot removed the stale label Feb 8, 2021
@github-actions
Copy link

github-actions bot commented May 9, 2021

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label May 9, 2021
@borpin
Copy link
Author

borpin commented May 10, 2021

I still need some help to fix this error please. Just needs a check added that the value exists/is valid.

@github-actions github-actions bot removed the stale label May 10, 2021
@github-actions
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Aug 19, 2021
@borpin
Copy link
Author

borpin commented Aug 20, 2021

This is still a problem so should not be closed.

@github-actions github-actions bot removed the stale label Aug 20, 2021
@github-actions
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@dvbit
Copy link

dvbit commented Jun 12, 2022

bump. help needed

@mitchando96
Copy link

Agreed. This issue was a headache to solve. If one feed reports 'null' every other sensor stops updating.

@bwduncan
Copy link
Contributor

Fixed by #76074

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants