2021-11-29 11:18:15 +01:00
import java.util.HashMap;
import java.util.Map;
import eu.hsrw.ias.ggd.SensorData
2021-12-14 14:52:02 +01:00
import javax.swing.JOptionPane
import HttpCall.HttpPost
import eu.hsrw.ias.ggd.Notification
import eu.hsrw.ias.ggd.Severity;
import eu.hsrw.ias.ggd.Device;
2021-11-29 11:18:15 +01:00
rule "DielectricPermittivity"
when
2021-12-14 14:52:02 +01:00
device: Device(sensorDatas: sensorData)
sensorData: SensorData(tag == "dielectricPermittivity", value > 20.0) from sensorDatas
2021-11-29 11:18:15 +01:00
then
2021-12-14 14:52:02 +01:00
String greenhouse1="8bdbe6ae-eafb-4e99-bb01-db8784dd9633";
HttpPost httpPost = new HttpPost();
final String dielectricPermittivityOutput = String.format("{\"id\":\"%s\",\"data\":{\"measured\":[{ \"status\": \"Critical dielectricPermittivity %s in the following sensor %s \", \"dielectricPermittivityOutput\": %s}]}}",greenhouse1, sensorData.getValue(),sensorData.getTag(),sensorData.getValue());
httpPost.HttpCallPost("http://connector.dev.whysor.com/default/insert?access_token=3hosOhAeh4k0XmcuAMQGfYldvTuQDvtAj2PJJ4irKPBefD5Ijij6gnUkLtVLd4fW",dielectricPermittivityOutput);
2022-02-07 11:25:56 +01:00
insert(new Notification("dielectricPermittivity", sensorData, Severity.Warning));
2021-11-29 11:18:15 +01:00
end