Skip to content

Data reading

Data from tcPDU can be read on demand by special HTTP request and MQTT command. All device parameters are divided into reading groups, so that only the desired values can be freely selected and read. The response contains variables from selected groups in JSON format.

HTTP

Two queries are available - one for static data and one for dynamic data (a conventional term). The data to be read is selected by placing selected groups as parameters of the HTTP query as follows:

  • static data:

    http://[IP]/api/v1/read/set/?[GRUPA 1]
    
    http://[IP]/api/v1/read/set/?[GRUPA 1]&[GRUPA 2]&[GRUPA 3]
    

    e.g.

    http://192.168.1.130/api/v1/read/set/?outConfig
    
    http://192.168.1.130/api/v1/read/set/?outConfig&dsConfig&i2cConfig&diffConfig
    
  • dynamic data:

    http://[IP]/api/v1/read/status/?[GRUPA 1]
    
    http://[IP]/api/v1/read/status/?[GRUPA 1]&[GRUPA 2]&[GRUPA 3]
    

    e.g.

    http://192.168.1.130/api/v1/read/status/?boardValues
    
    http://192.168.1.130/api/v1/read/status/?boardValues&statusValues&timeValues&outValues&dsValues&i2cValues&diffValues
    

A complete list of groups and their data is described in List of groups.

MQTT

This feature will be available in a future firmware release.

The command to read data via MQTT should be sent like other MQTT commands (more about this). The command format is as follows:

read=[GRUPA 1]

read=[GRUPA 1]&[GRUPA 2]&[GRUPA 3]

List of groups

Groups of readings are divided into two types:

  • with static data such as settings, names of sensor readings
  • with dynamic data such as sensor readings

Group types are read by separate queries, and each query may contain many groups (reading method described above).

In the list below, the names of some variables are supplemented with {X,Y}, which means that it is a set of readings. For example, iDValue{1,2} corresponds to iDValue1 and iDValue2, and oledLine{1,4}{1,4} corresponds to oledLine1, oledLine12, oledLine13, oledLine14, oledLine21, oledLine22, oledLine23, oledLine24, oledLine31, oledLine32, oledLine33, oledLine34, oledLine41, oledLine42, oledLine43, oledLine44.

Static data

  • generalConfig

    [
        "hardwareVersion",
        "softwareVersion",
        "mqttDeviceID",
        "modemPresent"
    ]
    
  • webConfig

    [
        "webRefresh",
        "webLanguage",
        "webUserSetNames",
        "webReadOnlyUser",
        "webAutoSignIn",
        "webHomepage",
        "webCheckUpdates",
        "webVisibility",
        "webPositionTop",
        "webPositionLeft",
        "picture"
    ]
    
  • varConfig

    [
        "varName{1,8}"
    ]
    
  • outConfig

    [
        "outName{1,7}",
        "outAutoSwitch{1,7}",
        "outAutoSwitchH{1,7}",
        "outAutoSwitchL{1,7}",
        "outStartOn{1,7}",
        "outStartOnTime{1,7}",
        "outResetTime{1,7}",
        "outSaveState{1,7}",
        "outNegation",
        "outLock"
    ]
    
  • dsConfig

    [
        "dsName{1,8}",
        "dsID{1,8}",
        "dsOffset{1,8}"
    ]
    
  • i2cConfig

    [
        "i2cTempName",
        "i2cHumName",
        "i2cSensor",
        "i2cFrequency"
    ]
    
  • diffConfig

    [
        "diffName{1,6}",
        "diffConfig1S{1,6}",
        "diffConfig2S{1,6}",
        "diffConfigO{1,6}"
    ]
    
  • iDConfig

    [
        "iDName{1,2}",
        "iDNegation{1,2}",
        "iDBistable{1,2}",
        "iDBistableTime{1,2}"
    ]
    
  • modemConfig

    [
        "modemCode",
        "modemAPN",
        "modemNumberEv{1,4}",
        "modemTextEvT{1,4}",
        "modemTextEvF{1,4}",
        "modemReturnSMS"
    ]
    
  • powerConfig

    [
        "powerName{1,6}",
        "powerIOption{1,6}",
        "powerCounting{1,6}",
        "powerSaveToMem"
    ]
    
  • eventConfig

    [
        "event{1,20}"
    ]
    
  • scheduleConfig

    [
        "schedule{1,50}"
    ]
    
  • wdConfig

    [
        "wdConfig{1,7}"
    ]
    
  • httpConfig

    [
        "httpReadingCode",
        "httpDigestAuth",
        "httpPerEnabled",
        "httpPerPeriod",
        "httpPerURL",
        "httpURLEvT{1,4}",
        "httpURLEvF{1,4}"
    ]
    
  • mqttConfig

    [
        "mqttEnabled",
        "mqttAuth",
        "mqttTLS",
        "mqttLWT",
        "mqttHost",
        "mqttPort",
        "mqttLogin",
        "mqttPassword",
        "mqttPrefix",
        "mqttPeriod",
        "mqttKeepAlive",
        "mqttSend"
    ]
    
  • snmpConfig

    [
        "snmpTrapEnabled",
        "snmpV2Enabled",
        "snmpV3Enabled",
        "snmpCommRead",
        "snmpCommWrite",
        "snmpCommTrap",
        "snmpTrapReceive",
        "snmpUser",
        "snmpAuthPass",
        "snmpPrivacyPass"
    ]
    
  • networkConfig

    [
        "netHostname",
        "netHttpPort",
        "netHttpsOn",
        "netMac",
        "netDhcp",
        "netIp",
        "netMask",
        "netGateway",
        "netDns1",
        "netDns2",
    ]
    
  • timeConfig

    [
        "timeNTP",
        "timeNTPHost",
        "timeNTPPort",
        "timeTimezone",
        "timeNTPPeriod"
    ]
    
  • accessConfig

    [
        "auth",
        "upgr",
        "adminLogin",
        "adminPass",
        "userLogin",
        "userPass",
        "authUser{1,50}"
    ]
    
  • emailConfig

    [
        "emailHost",
        "emailPort",
        "emailTLS",
        "emailUser",
        "emailPassword",
        "emailSender",
        "emailWdTo",
        "emailWdSubj",
        "emailWdText",
        "emailToEvT{1,4}",
        "emailToEvF{1,4}",
        "emailSubjEvT{1,4}",
        "emailSubjEvF{1,4}",
        "emailTextEvT{1,4}",
        "emailTextEvF{1,4}"
    ]
    
  • oledConfig

    [
        "oledEnabled",
        "oledTime",
        "oledSize",
        "oledScreen{1,4}",
        "oledLine{1,4}{1,4}",
        "oledFrequency"
    ]
    

Dynamic data

  • boardValues

    [
        "uRms",
        "iRms",
        "pActive",
        "pApparent",
        "pReactive",
        "pFactor",
        "pospf",
        "posang"
    ]
    
  • statusValues

    [
        "restartFlag",
        "oledScreenNow",
        "mqttConnected"
    ]
    
  • outValues

    [
        "out{1,7}",
        "outAutoSwitchE{1,7}"
    ]
    
  • dsValues

    [
        "ds{1,8}",
        "dsReadID"
    ]
    
  • i2cValues

    [
        "i2cTemp",
        "i2cHum",
        "dewPoint"
    ]
    
  • diffValues

    [
        "diff{1,6}"
    ]
    
  • iDValues

    [
        "iDValue{1,2}"
    ]
    
  • modemValues

    [
        "modemConsole",
        "modemConnected",
        "modemRegistered"
    ]
    
  • powerValues

    [
        "power{1,6}",
        "energy{1,6}"
    ]
    
  • eventValues

    [
        "eventConditionResult{1,20}"
    ]
    
  • varValues

    [
        "var{1,8}"
    ]
    
  • wdValues

    [
        "wdEnableStatus",
        "wdPingTime",
        "wdPingFailCount",
        "wdRestartCount"
    ]
    
  • timeValues

    [
        "time",
        "uptimeDays",
        "uptimeHours",
        "uptimeMinutes",
        "uptimeSeconds"
    ]