Thanks, I succeeded to send 2 data to 1 stream.
I have one question.
I set light sensor from “BUILD->Device->Resource” windows and created “light” streams.
If I create this multiple resources at Edge action, I saw this data in “Default” streams, too.
How many message do I use, only 1 message or 2 message?
Messages can be generated via observations directly to the cloud or sent to the edge actions for instance. The edge action (on the device) can be programmed to send the data to the cloud or perform some action on the device without sending a message to the cloud. If your edge action sends data to 2 cloud streams, that is counted as 2 messages.
If you send data via observations via 2 paths, one direct to the cloud (:default) and one to and edge action that then sends the data to another stream, that will be 2 messages.
If customer utilizes thermometer to edge action and wishes to include Humidity and Wind Speed, the edge action would receive the messages in the stream created by the observation. for the thermometer and the use the datahub read to gather the humidity and speed from those resources (they have to be enabled and have a polling period on those resources. The edge action would combine the thermometer data from the stream with the humidity and speed (read from the datahub) and send the entire payload to a stream for processing from a cloud action. when you read data using the datahub, this does not count as a message.
Here is an example of reading a resource (could be humidity) where the resource is enabled and polling is set.
var res_datetime = Resource.readValue(“/util/time/value”);
Here you see it added to the input stream data (thermometer)
“temperature”: event.value, // this is from the messages in the stream as input to the edge action
“humidity”: Datahub.read(‘/humidity/value’,0).value, // old datahub read method
“datetime”: Resource.readValue(“/util/time/value”) // new datahub read method