gtdiehl / iotawattpy Goto Github PK
View Code? Open in Web Editor NEWPython interface for the IoTaWatt device
License: GNU General Public License v3.0
Python interface for the IoTaWatt device
License: GNU General Public License v3.0
Could you please tag the source? This allows distributions to get the complete source from GitHub.
Thanks
I installed and try to run iotawatt HACS custom component for Home Assistant and I'm running into the following issue. @gtdiehl asked me on the issue on the other repo to open the issue here too:
Logger: custom_components.iotawatt
Source: custom_components/iotawatt/init.py:106
Integration: iotawatt
First occurred: August 2, 2021, 10:48:17 PM (2400 occurrences)
Last logged: 6:52:41 PM
Unexpected error fetching IoTaWatt data: 'NoneType' object has no attribute 'text'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 187, in _async_refresh
self.data = await self._async_update_data()
File "/config/custom_components/iotawatt/__init__.py", line 106, in _async_update_data
await self.api.update()
File "/usr/local/lib/python3.9/site-packages/iotawattpy/iotawatt.py", line 67, in update
await self._createSensors()
File "/usr/local/lib/python3.9/site-packages/iotawattpy/iotawatt.py", line 81, in _createSensors
results = response.text
AttributeError: 'NoneType' object has no attribute 'text'
The integration requires a MAC address for a unique ID. The MAC address is not being retrieved because the integration never calls connect()
.
Pardon the double-post... i'm not sure if this is an API issue or with the integration. i'm having a terrible time getting a "Solar Surplus" output showing up in HA.
Basically HA seems to want a "return to grid" sensor rather than just looking at negative grid_total values (which would make more sense to me, but whatever). So i created an output called "Solar_Surplus" that looks like this:
Watts = 0 max (-1 x (Main_1 + Main_2))
(alternately, also tried this:)
Watts = 0 max (0 - main_1 - main_2)
The wattage sensor works just fine, but I get 0 kwh for the _kw version. It also appears to never refresh until an HA restart.
FYI, my Grid_Consumed output works just fine, with
Watts = 0 max (Main_1 + Main_2)
Any suggestions? On the Iotawatt itself using the Graph+ UI, i can see these guys no problem in WH over a year, month etc.
The Query URL does not contain the unit type for most sensors. When the unit type is not specified IoTaWatt then uses the default which might give unexpected values.
I found my way here after having trouble setting up IotaWatt in Home Assistant. After a lot of reading, I've come to the conclusion that the Accumulated
sensors in Home Assistant should never be used. They cause wildly inaccurate data in the HA energy dashboard. According to Bob, IotaWatt's integration feature makes this obsolete because:
The Accumulated
sensors in HA are known here as _total
. So I suggest removing all these _total
sensors, essentially reverting 4262ab2. If there is no dissent, I'll work on a PR for this and also for the HA integration.
A side-effect of PR #10 is now another call is being made to the device every polling cycle, for a value that will never change.
I have iotawatt and HASS, am a Debian developer, and have some experience with Python, maintenance, releases (check @yarikoptic and projects keen to my heart)... I would be happy to help if at least to keep project in non-abandoned shape. If you agree for help - please add me as a collaborator on this repo and pypi (I am yarikoptic there as well).
Cheers
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.