传感能量监测器的api
sense-energ的Python项目详细描述
感知API
感知能量监视器API接口[WIP]
对传感器数据的系统访问。从语义中提取数据的探索性工作 在其他工具中使用-SmartThings、ActiveTiles等。
基于powershell中所做工作的python版本: https://gist.github.com/mbrownnycnyc/db3209a1045746f5e287ea6b6631e19c
贡献者
请随意叉和公关!
待办事项
- 添加post/put where/if applicable
- cli
- 改进了错误处理
安装
pip install sense_energy
示例用法:
sense=Senseable()sense.authenticate(username,password)sense.update_realtime()sense.update_trend_data()print("Active:",sense.active_power,"W")print("Active Solar:",sense.active_solar_power,"W")print("Daily:",sense.daily_usage,"KW")print("Daily Solar:",sense.daily_production,"KW")print("Active Devices:",", ".join(sense.active_devices))
有很多方法可供您调用,因此可以根据您的喜好进行修改
如果使用api来记录数据,则只应创建senseable和
然后重用它来获取更新的统计数据创建实例验证
使用Sense API,最多每15-20分钟一次。
调用update_trend_data()
函数将更新所有趋势统计信息
并且get_realtime()
将检索最新的实时统计信息
默认情况下,get_realtime()的速率限制为每30秒一次调用。这个罐头
通过将可感知对象属性rate_limit
设置为不同的值来修改