API Reference

DataMailbox

class pydatamailbox.client.DataMailbox(account, username, password, devid, timeout=None)

Talk2M DataMailbox api client.

https://developer.ewon.biz/content/dmweb-api This client only supports: getstatus, getewons, getewon, syncdata

getdata(ewon_id, tag_id, from_ts, to_ts, limit=None)

getdata is used as a “one-shot” request to retrieve filtered data based on specific criteria. It is not destined to grab historical data with the same timestamp or enormous data involving the use of the moreData filter.

param ewon_id:The ID of the single Ewon gateway for which data from DataMailbox is requested.
param tag_id:ID of the single tag for which data from DataMailbox is requested.
param from_ts:Timestamp after which data should be returned. No data older than this time stamp will
be sent in ISO format.
param to_ts:Timestamp before which data should be returned. No data newer than this time stamp
will be sent in ISO format
param limit:The maximum amount of historical data returned. The historical data is the historical tag values but also the historical alarms. If you set the limit to 4, the response will consist in 4 historical tag values and 4 historical alarms (if available) for each tag of each Ewon gateway allowed bu the Talk2M token. If the size of the historical data saved in the DataMailbox exceeds this limit, only the oldest historical data will be returned and the result contains a moreDataAvailable value indicating that more data is available on the server. If limit is not used or is too high, the DataMailbox uses a limit pre-defined in the system (server-side).
getewon(ewonid=None, name=None)

Returns the configuration of the targeted Ewon as seen by the DataMailbox.

Parameters:
  • ewonid – ID of the Ewon as returned by the “getewons” API request.
  • name – Name of the Ewon as returned by the “getewons” API request.
getewons()

Returns the list of Ewons sending data to be stored in the DataMailbox. The result contains the following information for each Ewon:

  • its name and id,
  • its number of tags,
  • the date of its last data upload to the Data Mailbox.
getstatus()

Returns the storage consumption of the account and of each Ewon.

The result contains the following information:

  • number of history points currently stored in the DataMailbox for this account,
  • number of Ewons which send data to the DataMailbox.

The result also contains the following information for each Ewon listed:

  • its id,
  • its name,
  • its number of history points currently stored in the DataMailbox,
  • its date of the first history point currently saved in the DataMailbox,
  • its date of the last history point currently saved in the DataMailbox.
iterate_syncdata(last_transaction_id=None)

Returns an iterator on syncdata.

The syncdata API returns partial data and indicates if there are more data to load with moreDataAvailable. This helper will act as an iterator and yield an api response until there are no more data.

Parameters:last_transaction_id – The ID of the last set of data sent by the DataMailbox. By referencing the “lastTransactionId”, the DataMailbox will send a set of data more recent than the data linked to this transaction ID.
syncdata(last_transaction_id=None)

Retrieves all data of a Talk2M account incrementally.

Parameters:last_transaction_id – The ID of the last set of data sent by the DataMailbox. By referencing the “lastTransactionId”, the DataMailbox will send a set of data more recent than the data linked to this transaction ID.

M2Web

class pydatamailbox.client.M2Web(account, username, password, devid, timeout=None)

Talk2M M2Web api client.

https://developer.ewon.biz/content/m2web-api-0 This client only supports: getaccountinfo, getewons, getewon

getaccountinfo()

Retrieves the basic account information (reference, name, company).

It also retrieves the set of pools visible by user : pairs name/id as well as the name of each custom attribute. There are always 3 custom attributes listed. Some or all of them may be empty. The “accountType” attribute will either be “Free” (for non paying account) or “Pro” (for paying account).

getewon(ewonid=None, name=None)

Returns the configuration of the targeted Ewon as seen by the DataMailbox.

Parameters:
  • ewonid – ID of the Ewon as returned by the “getewons” API request.
  • name – Name of the Ewon as returned by the “getewons” API request.
getewons()

Returns the list of Ewons the set of Ewons visible by user.

Returns displayable names, link names, status, description, the 3 custom attributes, preferred m2web server hostname (currently always m2web.talk2m.com).