Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
ezeio2:apiref:subscribe [2021-01-27 00:10] – andreh | ezeio2:apiref:subscribe [2021-01-27 22:23] – andreh | ||
---|---|---|---|
Line 1: | Line 1: | ||
==== subscribe ==== | ==== subscribe ==== | ||
- | Request a websocket data stream, and commands to manage the data stream | + | Request a websocket data stream, and commands to manage the data stream. |
=== Description === | === Description === | ||
Line 104: | Line 104: | ||
The data received will have a '' | The data received will have a '' | ||
- | | LOGDATA | The field data is from the 'fast log'. The interval is determined by the log interval setting on each field. | | + | | '' |
- | | STATUS | The field data is from the ' | + | | '' |
Note that the ezeio normally buffers data before the data is uploaded to the cloud servers, so the data may be delayed with up to 20 minutes | Note that the ezeio normally buffers data before the data is uploaded to the cloud servers, so the data may be delayed with up to 20 minutes | ||
Line 115: | Line 115: | ||
With an open websocket and while receiving data from the ezeio system, you can call the subscribe API to request immediate updates or to cancel updates from a certain ezeio. | With an open websocket and while receiving data from the ezeio system, you can call the subscribe API to request immediate updates or to cancel updates from a certain ezeio. | ||
- | To request | + | To request |
- | < | + | < |
+ | The log updates will revert to normal (buffered) mode after 30 minutes. | ||
To cancel updates, the call is: | To cancel updates, the call is: | ||
Line 122: | Line 123: | ||
Multiple requests can be sent in the same command: | Multiple requests can be sent in the same command: | ||
- | < | + | < |
+ | Up to 50 devices can be included in the same command | ||
=== Example code (PHP) === | === Example code (PHP) === | ||
Line 135: | Line 136: | ||
// Using the textalk/ | // Using the textalk/ | ||
+ | // https:// | ||
require(' | require(' | ||
use WebSocket\Client; | use WebSocket\Client; | ||
- | // Request a websocket key using cURL | + | // Request a websocket key and metadata |
$ch = curl_init(); | $ch = curl_init(); | ||
curl_setopt($ch, | curl_setopt($ch, |