thingsboard-python-rest-client icon indicating copy to clipboard operation
thingsboard-python-rest-client copied to clipboard

[Feature] Support exporting of telemetry data using python PE rest client

Open gaurav36 opened this issue 3 years ago • 4 comments

Description: Currently we are missing support for some important feature in the python tb rest client version 1.4 , for eg: getting telemetry data

As i can see in github source code, we are not loading this telemetry module [1] https://github.com/thingsboard/thingsboard-python-rest-client/blob/master/tb_rest_client/rest_client_pe.py#L1567&#L1608

Expected behavior: User should be able to get telemetry data using python rest client.

Additional Information: python rest client version: 1.4

gaurav36 avatar Aug 18 '22 13:08 gaurav36

Hi @gaurav36, rest client support getting telemetry: зображення

зображення

For example: rest_client.get_latest_timeseries(EntityId('d1cfaff0-a390-11ec-8112-ad8278896f52', 'DEVICE')) зображення

samson0v avatar Aug 19 '22 07:08 samson0v

@samson0v Thanks for this update. Do you have any documentation of this API ?

your screenshot is not complete
image

gaurav36 avatar Aug 23 '22 12:08 gaurav36

@samson0v In the python rest client https://paste.ubuntu.com/p/psFJq4pwfB/ I am using the PEca client and in the error logs its using api_ce https://paste.ubuntu.com/p/gY4K3zyBPC/

here I am passing arg1: file_name_to_save_timeseries_data, arg2: tenant_id, arg3: keys, arg4: start_time, arg5: endtime

I even tried, but its giving empty results (res={}) res = rest_client.get_timeseries(EntityId('my_tenant_id', 'TENANT'), keys="epc,locationId", start_ts="1660037511000", end_ts="1661247111000") print("latest timeseries from tenant is: {}".format(res))

May be you can write here full api call for getting timeseries data from particular tenant. for eg: rest_client.get_timeseries(entity_id=entityId, keys=keys, start_ts=startTs, end_ts=endTs)

gaurav36 avatar Aug 23 '22 12:08 gaurav36