|
<< Click to Display Table of Contents >> Publish |
![]() ![]()
|
Should be requested periodically to get tags values that have changed.
REQUEST:
URI: https://cloud.teslascada.com/publish
BODY: You can use Query format: clientid={clientid}&token={token}&publishid={publishid}
Or JSON format:
{
"clientid": {clientid},
"token": {token},
"publishid":{publishid}
}
Where:
{clientid} - ID of your client
{token} - Your TeslaCloud token that you got after connecting
{publishid} - Confirmation of the previous publish response.
RESPONSES:
•200 Success. Get all tags values that have changed.
BODY JSON format:
{
"publishid": {publishid},
"subscribetags":[
{"name": {tagname},"tagvalue":{tagvalue},"datetime":{datetime},"path":{tagpath},"quality":{quality}},
{"name": {tagname},"tagvalue":{tagvalue},"datetime":{datetime},"path":{tagpath},"quality":{quality}},
...............................................................................................................................................................
]
}
Where:
{publishid} - ID of the publish response. You have to confirm it in the next request.
{tagname} - Name of the tag.
{tagvalue} - Value of the tag in String format.
{datetime} - Date and time of the tag's value in unix epoch format (milliseconds since January 1, 1970 00:00:00).
{tagpath} - Path of the tag in UNS.
{quality} - Quality of the tag's value (0-GOOD, 1-UNCERTAIN, 2-BAD).
•400 Not success. Could not get tag's values.
EXAMPLE:
REQUEST:
Query format: clientid=0&token=fsgeEG&publishid=11
RESPONSE: 200
JSON format:
{
"publishid": 12,
"subscribetags":[
{"name": "Temperature","tagvalue":"24.5","datetime":17653405822171,"path":"GroupId/EdgeNodeID/DeviceID/House1/FirstFloor/Temperature","quality":0},
{"name": "Humidity","tagvalue":"17.7","datetime":17653405822171,"path":"GroupId/EdgeNodeID/DeviceID/House1/FirstFloor/Humidity","quality":0}
]
}