For the context you describe you have to define a listener watching the device (or the set of devices: group, service or project) for a data_state_change event to happen. Then you can track status changes and react.
For example you can setup a listener with this configuration:
· Group: myListenedGroup@carriots
· Event: data_state_change
· If expression: true
· Then expression: code that send an email with context data
Full context data will be something like:
reason:[id_developer:defaultDevice@carriots, updater:carriots, enabled:true, frequency_stream:1440, status:disconnected, id_group:defaultGroup@carriots, n_str:1363278057, properties:null, checksum:null, type:Computer, id_model:null, sensor:Other, time_zone:Europe/Madrid, updated_at:1363274534, frequency_status:1440, description:null, name:defaultDevice, owner:carriots, created_at:1363274534, id_asset:null],
device:[id_developer:defaultDevice@carriots, frequency_stream:1440, _id:514134523454c5d75985b0001de, frequency_status:1440, status:ok, checksum:null],
Where “reason” holds the device data that has caused the change state event. In this example the device goes to a disconnected status.
If you don’t have seen any activity is probably because you don’t have a “seed” stream. This stream is not a particular one, it is simply a stream (data or status) needed by Carriots to calculate the next stream expected arrival time by adding the frequency (stream or status) to the stream “at” timestamp.
So, you need to send a stream to let Carriots know when you expect the next one to arrive and fire the event if it does not occur.