Comments (13)
This would be great. I see "There are plenty of methods for you to call" but is there a list somewhere?
from sense.
Pretty much all the functions in this file: https://github.com/scottbonline/sense/blob/stable/sense_energy/senseable.py
from sense.
Cool, I'll submit a PR to update the docs.
from sense.
I haven't done that before for an open-source project. Should it be off master
or a new branch?
from sense.
I haven't done that before for an open-source project. Should it be off
master
or a new branch?
If it is a PR I think branching off master should work.
from sense.
Can someone familiar with the code provide one-sentence descriptions for these methods? I have not used it, just trying to help the documentation so that more people can. I have descriptions for the rest from the source.
get_trend_data
get_discovered_device_names
get_discovered_device_data
get_all_usage_data
from sense.
First it's important to know there are two implementations, the async version and the sync version. Apps that use async IO can use the async version, pretty much everyone else will want the sync version.
Then there are two types of API calls made by the library. Those to get the realtime data, and those to get trend/device/usage/historic data.
As for the functions:
get_trend_data
fetches the trend data for a scale of time (e.g. day, month, year). It's mostly used when called by update_trend_data which will get the trend data for all of the scales
get_discovered_device_names
returns a list of the names of devices discovered
get_discovered_device_data
returns a list of the discovered devices including all the data available on the API (name, type, powered on, etc)
get_all_usage_data
had a bug and didn't work, I just pushed a fix. It returns the last 30 usage events like devices being turned on for X minutes
I also just removed the function get_notification_preferences
as it no longer worked
from sense.
Thanks! I'm about to push a PR that has documentation on methods. While I know what sync and async mean, I don't know exactly what it means in this context. Feel free to add that info as it also seems like useful info.
from sense.
I was curious about this API as well. I got it working very quickly, thank you, grabbing my solar vs my usage to figure out if I had any free solar and I wrote an app (TesSense) that allows my Tesla to change the rate it charges at.
Then I wanted to know more about the API and I just finished the app SenseAPI.py (https://github.com/israndy/SenseAPI) that lets you call each of the functions. But a few of them are not obvious and could use some documentation. The Example Async code must have some dependancies that I don't understand
from sense.
The async code (for the Kasa emulation) should only require asyncio to be imported. Aside from that the async and non-async versions behave pretty similarly. Which functions need documenting more?
Side note: might not want to include login credentials in something you put publicly online
from sense.
from sense.
from sense.
I added a little more documentation for a few of the key functions. In terms of structure, there are two main parts the library:
- The Sense Web API interface
- The Local smart plug interface
For the web API (Senseable or AsyncSenseable objects) there is long term "Trend" data and instantaneous "Realtime" data. The realtime data can be read either as just one update (what the current devices are doing now), or as a stream of updates (similar to viewing in the app).
For the smart plug interface (SenseLink object), its purpose is to run a server that replies with available smart plugs and sends out updates when requested by the monitor. It won't really do much by itself
from sense.
Related Issues (20)
- daily_usage and daily_solar off by ~4 hours HOT 4
- Slamming Sense's internal API with authentication requests HOT 3
- pip install sense_energy fails because it can't find README.md HOT 5
- Repeat print every 5 seconds HOT 6
- Error appearing with new websocket version HOT 2
- Can't run on python 2.7.6 HOT 3
- ModuleNotFoundError: No module named '__main__.sense_exceptions'; '__main__' is not a package HOT 5
- Websocket connection failure for realtime data HOT 4
- 'Senseable' object has no attribute 'rate_limit' HOT 4
- Question: Disconnect logs? HOT 2
- Timeouts - after 7pm every day?? HOT 3
- Allows passing in websession HOT 3
- MQTT support HOT 1
- Leg1 Leg2 Data for 400amp Split Systems - Wattage reading incorrect HOT 2
- Calling get_realtime() doesn't seem to update data without re-authentication
- get_all_usage_data for time period HOT 1
- Tag names are inconsistent HOT 1
- JSONDecodeError After One Hour HOT 10
- API works for an hour then fails HOT 1
- get_trend_data method doesn't return anything HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sense.