主页

您的下载文件夹中的项目

下载文件夹为空。
下载文件夹中的项目

!

查看下载文件夹
前往下载中心

您购物车中的物品

购物车为空
购物车中的物品

Solution

数量:
总计:
查看购物车 / 项目清单
打开其他的项目清单
导出为 .xlsx 导出为 .csv 从 .csv文件导入 从 .bel 文件导入
已停产的产品
  • 欢迎光临, {0} - 我的帐户

    我的帐户


    • 退出
    登录/注册
  • 产品

    执行器

    • 执行器选型
    • 非自复位执行器
    • 自复位执行器
    • 适于恶劣环境条件的执行器
    • 快速运行执行器
    • 直行程执行器
    • 防火风阀执行器
    • 排烟控制风阀执行器
    • 变风量
    • 阀门执行器
    • 配件

    阀门

    • 阀门选型
    • 搏力谋能量阀®
    • 压力无关型控制阀
    • 区域阀
    • 特性控制阀
    • 球阀
    • 蝶阀
    • 截止阀
    • 阀门执行器
    • 配件

    传感器/计量表

    • 传感器/计量表选型
    • 风管传感器(空气)
    • 管道传感器(水)
    • 室外传感器(空气)
    • 室内控制面板
    • 气体探测 (空气)
    • 热能表 (TEM)
    • 带热能表的搏力谋能量阀®
    • 配件

    系统

    • 搏力谋能量阀®
    • 室内解决方案
    • 总线和系统集成
    • 搏力谋ZoneEase™ VAV
    • 配件

    RetroFIT+

    • RetroFIT+ 产品更换工具
    • RetroFIT+ 改造更新产品
    • 充分发挥系统潜力
    • 技术升级系统
    • 完善现有系统
    navigation-teaser_2_sc
  • 支持

    工具

    • 搏力谋网上商城
    • 执行器选型
    • 阀门选型
    • 传感器/计量表选型
    • RetroFIT+ 产品更换工具
    • RetroFIT+ App
    • 搏力谋显示屏App
    • 搏力谋小助手App
    • 搏力谋云
    • ZoneEase VAV 云
    • ZoneEase VAV 手机小程序
    • 手持编程设备
    • BIM(楼宇信息建模)
    • PC-Tool

    搏力谋学习中心

    • 健康的室内空气质量
    • 体验中心虚拟游览
    • 网络研讨会
    • 网上商城操作指南

    链接

    • 文档下载
    • 网络研讨会
    • 视频
    • Website Tutorials
  • 关于搏力谋

    搏力谋

    • 公司介绍
    • 我们的价值观
    • 可持续性发展
    • 历史
    • 奖项和荣誉
    • 关联机构
    • 搏力谋质量
    • 客户服务和支持

    工作机会与职业发展

    • 工作机会
    • Culture@BELIMO
    • 福利待遇
    • 招聘程序
    • 职业发展
    Nevigation-image-4

    投资者关系

    • 关键数据比较
    • 报告和演示
    • 即时公司新闻
    • 搏力谋股份
    • 企业治理
    • 年度股东大会
    • 财务日志
    • 联系方式

    媒体

    • 新闻
    • 亮点
    • 成功案例
    • 视频
    • 图片和商标
    • 活动安排
    • 联系方式
    Nevigation-image-1
  • 联系我们
  • 中国

    美洲

    • 巴西
    • 加勒比地区、拉丁美洲和美国
    • 加拿大

    欧洲、中东和非洲

    • 阿尔巴尼亚
    • 阿联酋 (免税区机构)
    • 爱尔兰
    • 爱沙尼亚
    • 奥地利
    • 白俄罗斯
    • 保加利亚
    • 北马其顿
    • 比利时
    • 波兰
    • 波斯尼亚和黑塞哥维那
    • 丹麦
    • 德国
    • 法国
    • 芬兰
    • 格鲁吉亚
    • 哈萨克斯坦
    • 荷兰
    • 捷克共和国
    • 克罗地亚
    • 拉脱维亚
    • 立陶宛
    • 罗马尼亚
    • 南非
    • 挪威
    • 瑞典
    • 瑞士
    • 塞尔维亚与黑山共和国
    • 沙特阿拉伯
    • 斯洛伐克
    • 斯洛文尼亚
    • 土耳其
    • 乌克兰
    • 西班牙
    • 希腊
    • 匈牙利
    • 以色列
    • 意大利
    • 英国

    亚太地区

    • 澳大利亚
    • 菲律宾
    • 韩国
    • 柬埔寨
    • 马来西亚
    • 缅甸
    • 日本
    • 泰国
    • 新加坡
    • 新西兰
    • 印度
    • 印度尼西亚
    • 越南
    • 中国
    • 中国澳门特区
    • 中国台湾
    • 中国香港特别行政区
    中文

    中文

    英语

  • 中国

    美洲

    • 巴西
    • 加勒比地区、拉丁美洲和美国
    • 加拿大

    欧洲、中东和非洲

    • 阿尔巴尼亚
    • 阿联酋 (免税区机构)
    • 爱尔兰
    • 爱沙尼亚
    • 奥地利
    • 白俄罗斯
    • 保加利亚
    • 北马其顿
    • 比利时
    • 波兰
    • 波斯尼亚和黑塞哥维那
    • 丹麦
    • 德国
    • 法国
    • 芬兰
    • 格鲁吉亚
    • 哈萨克斯坦
    • 荷兰
    • 捷克共和国
    • 克罗地亚
    • 拉脱维亚
    • 立陶宛
    • 罗马尼亚
    • 南非
    • 挪威
    • 瑞典
    • 瑞士
    • 塞尔维亚与黑山共和国
    • 沙特阿拉伯
    • 斯洛伐克
    • 斯洛文尼亚
    • 土耳其
    • 乌克兰
    • 西班牙
    • 希腊
    • 匈牙利
    • 以色列
    • 意大利
    • 英国

    亚太地区

    • 澳大利亚
    • 菲律宾
    • 韩国
    • 柬埔寨
    • 马来西亚
    • 缅甸
    • 日本
    • 泰国
    • 新加坡
    • 新西兰
    • 印度
    • 印度尼西亚
    • 越南
    • 中国
    • 中国澳门特区
    • 中国台湾
    • 中国香港特别行政区
  • 中文 EN
  • 欢迎光临, {0} - 我的帐户

    我的帐户


    • 退出
    登录/注册
主页
  • 产品

    执行器

    • 执行器选型
    • 非自复位执行器
    • 自复位执行器
    • 适于恶劣环境条件的执行器
    • 快速运行执行器
    • 直行程执行器
    • 防火风阀执行器
    • 排烟控制风阀执行器
    • 变风量
    • 阀门执行器
    • 配件

    阀门

    • 阀门选型
    • 搏力谋能量阀®
    • 压力无关型控制阀
    • 区域阀
    • 特性控制阀
    • 球阀
    • 蝶阀
    • 截止阀
    • 阀门执行器
    • 配件

    传感器/计量表

    • 传感器/计量表选型
    • 风管传感器(空气)
    • 管道传感器(水)
    • 室外传感器(空气)
    • 室内控制面板
    • 气体探测 (空气)
    • 热能表 (TEM)
    • 带热能表的搏力谋能量阀®
    • 配件

    系统

    • 搏力谋能量阀®
    • 室内解决方案
    • 总线和系统集成
    • 搏力谋ZoneEase™ VAV
    • 配件

    RetroFIT+

    • RetroFIT+ 产品更换工具
    • RetroFIT+ 改造更新产品
    • 充分发挥系统潜力
    • 技术升级系统
    • 完善现有系统
    navigation-teaser_2_sc
  • 支持

    工具

    • 搏力谋网上商城
    • 执行器选型
    • 阀门选型
    • 传感器/计量表选型
    • RetroFIT+ 产品更换工具
    • RetroFIT+ App
    • 搏力谋显示屏App
    • 搏力谋小助手App
    • 搏力谋云
    • ZoneEase VAV 云
    • ZoneEase VAV 手机小程序
    • 手持编程设备
    • BIM(楼宇信息建模)
    • PC-Tool

    搏力谋学习中心

    • 健康的室内空气质量
    • 体验中心虚拟游览
    • 网络研讨会
    • 网上商城操作指南

    链接

    • 文档下载
    • 网络研讨会
    • 视频
    • Website Tutorials
  • 关于搏力谋

    搏力谋

    • 公司介绍
    • 我们的价值观
    • 可持续性发展
    • 历史
    • 奖项和荣誉
    • 关联机构
    • 搏力谋质量
    • 客户服务和支持

    工作机会与职业发展

    • 工作机会
    • Culture@BELIMO
    • 福利待遇
    • 招聘程序
    • 职业发展
    Nevigation-image-4

    投资者关系

    • 关键数据比较
    • 报告和演示
    • 即时公司新闻
    • 搏力谋股份
    • 企业治理
    • 年度股东大会
    • 财务日志
    • 联系方式

    媒体

    • 新闻
    • 亮点
    • 成功案例
    • 视频
    • 图片和商标
    • 活动安排
    • 联系方式
    Nevigation-image-1
  • 联系我们
  • 已停产的产品
  • 您的下载文件夹中的项目

    下载文件夹为空。
    下载文件夹中的项目

    !

    查看下载文件夹
    前往下载中心
  • 您购物车中的物品

    购物车为空
    购物车中的物品

    Solution

    数量:
    总计:
    查看购物车 / 项目清单
    打开其他的项目清单
    导出为 .xlsx 导出为 .csv 从 .csv文件导入 从 .bel 文件导入
  1. 主页
  2. 建筑物联网
  3. Belimo Digital Ecosystem Developer Space

Plot your first graph in Python

In a few simple steps you can build your fully-functional application, main focus is on:

  • Gain access to the Service User Space
  • Select data
  • Acquire data
  • Plot

To have the complete example just cut and paste in a single file the code shown in the next paragraphs. 

This example has been designed for the demo environment so you will replace "__UserPlaceHolder__" and "__PasswordPlaceHolder__" with your BelimoID Account credential and "__ClientIDPlaceHolder__" and "__ClientSecretPlaceHolder__" with the credential you received for the Developer Space.

To access the complete documentation about our Cloud API log in http://cloud.belimo.com using your BelimoID and then chose "support" -> "Documentation" 

 

Python Libraries import

import requests
import json
import pandas as pd
import matplotlib.pyplot as plt
# enable inline pictures in Jupyter Notebook
%matplotlib inline
from oauthlib.oauth2 import LegacyApplicationClient
from requests_oauthlib import OAuth2Session

Set up the OAuth2.0 session

# OAuth Client
client_id = '__ClientIDPlaceHolder__'
client_secret = '__ClientSecretPlaceHolder__'
# OAuth user
user = '__UserPlaceHolder__'
passwd = '__PasswordPlaceHolder__'

# shorthand url
cloud = 'https://cloud.belimo.com'
oauth = OAuth2Session(client=LegacyApplicationClient(client_id=client_id))
token = oauth.fetch_token(
token_url='https://id.belimo.com/oauth/token',
username=user,
password=passwd,
client_id=client_id,
client_secret=client_secret,
include_client_id=True,
audience="https://api.cloud.belimo.com/",
scope=['public.read', 'offline_access', 'read:dataprofile'])

Get an overview of your devices

oauth.get(url=cloud + '/api/v3/devices/stats').json()

The output is then something like:

 

{
    'totalDevices': 36, 
    'connection': 
        {
         'offline': 1, 
         'online': 35
         }, 
    'health': 
        {
         'problem': 1, 
         'ok': 35
        }, 
    'transfer': 
        {
         'incoming': 0, 
         'outgoing': 0
        } 
}
         
     

Now we examine in more detail the devices seen and filter for those which are associated with heating:

# The id of the device (unique name)
# DisplayName: set during commissioning (allows for easy identification) (we will filter according to that one)
# Dataprofile: Where to find the information how to interprete data from the device
# url parameters
params = {
    'state': 'REGISTERED', # only get registered devices
    'limit': '100' # page size
}
# call API and print information
for device in oauth.get(url=cloud + '/api/v3/devices', params=params).json()['data']:
    if 'Heizung' in device['displayName']: # german word for 'Heating'
        print('id: ' + device['id'])
        print('name: ' + device['displayName'])
        print('dataprofile: ' + device['dataprofile']['entityId'])

The output is something like:

id: 5a430aa2-1d46-4776-bfe1-a10b6c567230
    name: Energieventil Heizung 2.OG Sued-Ost
    dataprofile: energyvalve3/1.2
    id: 3c563d80-48f0-4a7a-8701-65d65aefdd9c
    name: Energieventil Heizung 2.OG Nord-Ost
    dataprofile: energyvalve3/1.2
    id: 3c6f7077-a147-4d25-865f-e72901d9de62
    name: Energieventil Heizung 2.OG Nord-West
    dataprofile: energyvalve3/1.2
    id: b69b0b32-03ca-4ec4-8850-2a1b474fbd83
    name: Energieventil Heizung 1.OG Sued-West
    dataprofile: energyvalve3/1.2
    id: 0cc5b932-c7b0-4eab-87ae-153aec6a7f90
    name: Energieventil Heizung 2.OG Sued-West
    dataprofile: energyvalve3/1.2    

Now let's download the Dataprofile and find the datapoint of interest

let's say we are interested in the following device

  • id: 3c6f7077-a147-4d25-865f-e72901d9de62
  • name: Energieventil Heizung 2.OG Nord-West
  • dataprofile: energyvalve3/1.2
deviceid = '3c6f7077-a147-4d25-865f-e72901d9de62'
dataprofileid = 'energyvalve3/1.2'

dataprofiledef  = oauth.get(url=cloud + '/api/v3/definitions/dataprofiles/' + dataprofileid).json()
# Extract relevant datapoints
# Let's say we are interested in energy consumption
print('Energy related datapoints:')
for dp in dataprofiledef['datapoints']:
    if 'Energy' in dp['featureValues']['default.description']: # get those datapoints which are related to Energy
        print('id: ' + dp['id'])
        print('description: ' + dp['featureValues']['default.description'])

The output will be something like this:

    Energy related datapoints:
    id: evcloud.200
    description: Cooling Energy in J
    id: evcloud.210
    description: Heating Energy in J

let's get the state and historical values for the heating energy:

# Current state
# First we the current state of the device, and extract from it e.g. location
state = oauth.get(url=cloud + '/api/v3/devices/' + deviceid).json()
# We can print current Value
state['state']['datapoints']['evcloud.210']
# Set parameters to access the historical data
params = {
    'datapointIds': 'evcloud.210',
    'resolution': '1d',
    'from': '2017-12-01T00:00:00Z',
    'to': '2018-12-01T00:00:00Z'
}
data = oauth.get(url=cloud + '/api/v3/devices/' + deviceid + '/data/history/timeseries', params=params).json()
# Extract the time series
# We only queried for one series
# We are interested in the values, not the metadata
# construct pandas DataFrame from data
heatingEnergy = pd.DataFrame(data['series'][0]['values'])
# convert timestamp to pandas datetime
heatingEnergy['timestamp'] = pd.to_datetime(heatingEnergy.timestamp)
# Energy is cumulative -- here we compute the difference between timepoints and convert to kWh
heatingEnergy['DiffEnergyConsumption'] = heatingEnergy.value.diff() / 3600000

and then plot the energy consumption

heatingEnergy.plot(x='timestamp', y='DiffEnergyConsumption', marker='o', alpha=0.5, stacked=True, figsize=(20,10))

plt.show()

The outcome should look like this:

output_31_1

欢迎来到搏力谋 {{js-currentCountryName}}

{{js-currentCountryText}}
联系我们 搏力谋中国 — 条款和条件 沪ICP备2021027129号-1 隐私政策 更改隐私设置 版本说明
+86 21 5329 9299
Subscribe
搏力谋自控设备(上海)有限公司