The Following are the list of queries available on the Smart Farm project for both cloud and Gateway.
Cloud:
InstallCloud query: This query must run on cloud for the first time and starts up the subscriptions and initializes meta data and other required information on the cloud, this query will delete all previous data present on cloud and must be used cautiously.
Method POST Query <InstallCloud/> Response <ExecuteStatus eid="SetTimeInterval" Status="Success"/>
CloudSubscription query: This query must run every time the cloud is restarted and starts up the required subscriptions on the cloud.
Method POST Query <Query>
<CreateSystemConfigCloud/>
<SubscribeToZoneAggInfoForRegionCreate/>
<SubscribeToSensorForRegionAggInfo/>
<SubscribeToZoneAggInfoOnCreate/>
<SubscribeToZoneAggInfoOnUpdate/>
<RemoveStaleDataCloud/>
<RemoveStaleRegionDataCloud/>
</Query>Response <ExecuteStatus eid="RemoveStaleRegionDataCloud" Status="Success"/>
FindRegions query : This query will give all the regions present on the cloud.
Method POST Query <Query>
<Find format="Version,Known">
<Region>
<RegionID ne="" />
</Region>
</Find>
</Query>Response <Find Status="Success" Format="version,known"> <Result> <Region> <RegionID>LUZ2KPRPAAAH6AAAAHTQEJAW</RegionID> <RegionEnvData> <Pressure> <MaxValue Value="1000.0" Known="1000.0" Version="1"/> <MinValue Value="0.0" Known="0.0" Version="1"/> <Units Value="hPa" Known="hPa" Version="1"/> <CurrentValue Value="" Known="" Version="2170"/> </Pressure> <Humidity> <MaxValue Value="90.0" Known="90.0" Version="1"/> <CurrentValue Value="" Known="" Version="2170"/> <Units Value="%" Known="%" Version="1"/> <MinValue Value="65.0" Known="65.0" Version="1"/> </Humidity> <rainfall> <MaxValue Value="2000.0" Known="2000.0" Version="1"/> <Units Value="mm/h" Known="mm/h" Version="1"/> <MinValue Value="0.0" Known="0.0" Version="1"/> <CurrentValue Value="" Known="" Version="2170"/> </rainfall> <wind_speed> <CurrentValue Value="" Known="" Version="2170"/> <MinValue Value="0.0" Known="0.0" Version="1"/> <MaxValue Value="10.0" Known="10.0" Version="1"/> <Units Value="m/s" Known="m/s" Version="1"/> </wind_speed> <Light> <MaxValue Value="0.0" Known="0.0" Version="1"/> <MinValue Value="0.0" Known="0.0" Version="1"/> <CurrentValue Value="" Known="" Version="2170"/> <Units Value="" Known="" Version="2170"/> </Light> <Temperature> <MinValue Value="10.0" Known="10.0" Version="1"/> <MaxValue Value="40.0" Known="40.0" Version="1"/> <CurrentValue Value="" Known="" Version="2170"/> <Units Value="°C" Known="°C" Version="1"/> </Temperature> <sealevel_pressure> <CurrentValue Value="" Known="" Version="2170"/> <MaxValue Value="1000.0" Known="1000.0" Version="1"/> <MinValue Value="0.0" Known="0.0" Version="1"/> <Units Value="hPa" Known="hPa" Version="1"/> </sealevel_pressure> <uv> <MaxValue Value="4.0" Known="4.0" Version="1"/> <Units Value="" Known="" Version="2170"/> <CurrentValue Value="" Known="" Version="2170"/> <MinValue Value="0.0" Known="0.0" Version="1"/> </uv> <wind_angle> <MaxValue Value="360.0" Known="360.0" Version="1"/> <MinValue Value="0.0" Known="0.0" Version="1"/> <CurrentValue Value="" Known="" Version="2170"/> <Units Value="°" Known="°" Version="1"/> </wind_angle> <local_time Value="" Known="" Version="2170"/> <wind_direction Value="" Known="" Version="2169"/> </RegionEnvData> <Area> <LowerRight> <latitude Value="37.80191751" Known="37.80191751" Version="4276"/> <longitude Value="-122.45738983" Known="-122.45738983" Version="4276"/> </LowerRight> <UpperLeft> <longitude Value="-122.46642351" Known="-122.46642351" Version="4276"/> <latitude Value="37.80470646" Known="37.80470646" Version="4276"/> </UpperLeft> </Area> <Manager> <Name Value="Tom" Known="Tom" Version="1"/> </Manager> <MidPoint> <latitude Value="37.80331207" Known="37.80331207" Version="4276"/> <longitude Value="-122.46190658" Known="-122.46190658" Version="4276"/> </MidPoint> <Owner> <Name Value="Jerry" Known="Jerry" Version="1"/> </Owner> <Description Value="Region of North India" Known="Region of North India" Version="1"/> <Name Value="Region-T1" Known="Region-T1" Version="1"/> </Region> </Result> <Result> <Region> <RegionID>LVL2ZF6PAAAH6AAAAH2PSTTM</RegionID> <RegionEnvData> <Pressure> <MaxValue Value="1000.0" Known="1000.0" Version="1"/> <MinValue Value="0.0" Known="0.0" Version="1"/> <Units Value="hPa" Known="hPa" Version="1"/> <CurrentValue Value="" Known="" Version="17"/> </Pressure> <Humidity> <MaxValue Value="90.0" Known="90.0" Version="1"/> <CurrentValue Value="" Known="" Version="17"/> <Units Value="%" Known="%" Version="1"/> <MinValue Value="65.0" Known="65.0" Version="1"/> </Humidity> <rainfall> <MaxValue Value="2000.0" Known="2000.0" Version="1"/> <Units Value="mm/h" Known="mm/h" Version="1"/> <MinValue Value="0.0" Known="0.0" Version="1"/> <CurrentValue Value="" Known="" Version="17"/> </rainfall> <wind_speed> <CurrentValue Value="" Known="" Version="17"/> <MinValue Value="0.0" Known="0.0" Version="1"/> <MaxValue Value="10.0" Known="10.0" Version="1"/> <Units Value="m/s" Known="m/s" Version="1"/> </wind_speed> <Light> <MaxValue Value="0.0" Known="0.0" Version="1"/> <MinValue Value="0.0" Known="0.0" Version="1"/> <CurrentValue Value="" Known="" Version="17"/> <Units Value="" Known="" Version="17"/> </Light> <Temperature> <MinValue Value="10.0" Known="10.0" Version="1"/> <MaxValue Value="40.0" Known="40.0" Version="1"/> <CurrentValue Value="" Known="" Version="17"/> <Units Value="°C" Known="°C" Version="1"/> </Temperature> <sealevel_pressure> <CurrentValue Value="" Known="" Version="17"/> <MaxValue Value="1000.0" Known="1000.0" Version="1"/> <MinValue Value="0.0" Known="0.0" Version="1"/> <Units Value="hPa" Known="hPa" Version="1"/> </sealevel_pressure> <uv> <MaxValue Value="4.0" Known="4.0" Version="1"/> <Units Value="" Known="" Version="17"/> <CurrentValue Value="" Known="" Version="17"/> <MinValue Value="0.0" Known="0.0" Version="1"/> </uv> <wind_angle> <MaxValue Value="360.0" Known="360.0" Version="1"/> <MinValue Value="0.0" Known="0.0" Version="1"/> <CurrentValue Value="" Known="" Version="17"/> <Units Value="°" Known="°" Version="1"/> </wind_angle> <local_time Value="" Known="" Version="17"/> <wind_direction Value="" Known="" Version="17"/> </RegionEnvData> <Area> <LowerRight> <latitude Value="37.62510898" Known="37.62510898" Version="34"/> <longitude Value="-105.73516846" Known="-105.73516846" Version="34"/> </LowerRight> <UpperLeft> <longitude Value="-122.45704651" Known="-122.45704651" Version="34"/> <latitude Value="38.01780398" Known="38.01780398" Version="34"/> </UpperLeft> </Area> <Manager> <Name Value="Nam" Known="Nam" Version="1"/> </Manager> <MidPoint> <latitude Value="38.11839037" Known="38.11839037" Version="32"/> <longitude Value="-114.07370606" Known="-114.07370606" Version="34"/> </MidPoint> <Owner> <Name Value="Nam" Known="Nam" Version="1"/> </Owner> <Description Value="sample Description" Known="sample Description" Version="1"/> <Name Value="Region-T2" Known="Region-T2" Version="1"/> </Region> </Result> </Find>
FindZones query : This query will give all the zones present on the cloud.
Method POST Query <Query>
<Find format="Version,Known">
<Zone>
<ZoneID ne="" />
</Zone>
</Find>
</Query>Response
<Find Format="version,known" Status="Success">
<Result>
<Zone>
<ZoneID>LVL243IYAAAH6AAAAG56WIMC</ZoneID>
<Name Known="Zone3" Value="Zone3" Version="1"/>
<Size Known="0E-10" Value="0E-10" Version="16"/>
<Width Known="0E-10" Value="0E-10" Version="16"/>
<RegionID Known="Region-T2" Value="Region-T2" Version="1"/>
<Label Known="Zone3" Value="Zone3" Version="1"/>
<CropID Known="" Value="" Version="2"/>
<Height Known="0E-10" Value="0E-10" Version="16"/>
</Zone>
</Result>
<Result>
<Zone>
<ZoneID>LVL6366FAAAH6AAAAGUVTP5X</ZoneID>
<Name Known="Zone2" Value="Zone2" Version="1"/>
<Size Known="0E-10" Value="0E-10" Version="1"/>
<Width Known="0E-10" Value="0E-10" Version="1"/>
<RegionID Known="Region-T2" Value="Region-T2" Version="1"/>
<Label Known="Zone2" Value="Zone2" Version="1"/>
<CropID Known="" Value="" Version="1"/>
<Height Known="0E-10" Value="0E-10" Version="1"/>
</Zone>
</Result>
<Result>
<Zone>
<ZoneID>LVLUACHSAAAH6AAAAGYENNID</ZoneID>
<Name Known="SampleZone2" Value="SampleZone2" Version="1"/>
<Size Known="0E-10" Value="0E-10" Version="1"/>
<Width Known="0E-10" Value="0E-10" Version="1"/>
<RegionID Known="Region-T1" Value="Region-T1" Version="1"/>
<Label Known="SampleZone2" Value="SampleZone2" Version="1"/>
<CropID Known="" Value="" Version="1"/>
<Height Known="0E-10" Value="0E-10" Version="1"/>
</Zone>
</Result>
<Result>
<Zone>
<ZoneID>LVLUF4A7AAAH6AAAAFJTSUZE</ZoneID>
<Name Known="z1" Value="z1" Version="1"/>
<Size Known="0E-10" Value="0E-10" Version="1"/>
<Width Known="0E-10" Value="0E-10" Version="1"/>
<RegionID Known="Region-T1" Value="Region-T1" Version="1"/>
<Label Known="z1" Value="z1" Version="1"/>
<CropID Known="" Value="" Version="1"/>
<Height Known="0E-10" Value="0E-10" Version="1"/>
</Zone>
</Result>
<Result>
<Zone>
<ZoneID>LVLZOARJAAAH6AAAAH6LSII4</ZoneID>
<Name Known="SampleZone" Value="SampleZone" Version="1"/>
<Size Known="44690.3499999596" Value="44690.3499999596" Version="1"/>
<Width Known="6.0000000000" Value="6.0000000000" Version="23"/>
<RegionID Known="Region-T1" Value="Region-T1" Version="1"/>
<Label Known="SampleZone" Value="SampleZone" Version="1"/>
<CropID Known="Crop-1" Value="Crop-1" Version="1"/>
<Height Known="5.0000000000" Value="5.0000000000" Version="23"/>
</Zone>
</Result>
<Result>
<Zone>
<ZoneID>LVLZOASZAAAH6AAAAHTBTGLA</ZoneID>
<Name Known="z11" Value="z11" Version="1"/>
<Size Known="0E-10" Value="0E-10" Version="1"/>
<Width Known="0E-10" Value="0E-10" Version="1"/>
<RegionID Known="R1" Value="R1" Version="1"/>
<Label Known="z11" Value="z11" Version="1"/>
<CropID Known="" Value="" Version="1"/>
<Height Known="0E-10" Value="0E-10" Version="1"/>
</Zone>
</Result>
<Result>
<Zone>
<ZoneID>LVLZOATTAAAH6AAAAH42PQ4B</ZoneID>
<Name Known="Z12" Value="Z12" Version="1"/>
<Size Known="0E-10" Value="0E-10" Version="1"/>
<Width Known="0E-10" Value="0E-10" Version="1"/>
<RegionID Known="R1" Value="R1" Version="1"/>
<Label Known="Z12" Value="Z12" Version="1"/>
<CropID Known="" Value="" Version="1"/>
<Height Known="0E-10" Value="0E-10" Version="1"/>
</Zone>
</Result>
<Result>
<Zone>
<ZoneID>LVLZXFMZAAAH6AAAAGEFZCOS</ZoneID>
<Name Known="vds" Value="vds" Version="1"/>
<Size Known="0E-10" Value="0E-10" Version="1"/>
<Width Known="0E-10" Value="0E-10" Version="1"/>
<RegionID Known="R1" Value="R1" Version="1"/>
<Label Known="vds" Value="vds" Version="1"/>
<CropID Known="" Value="" Version="1"/>
<Height Known="0E-10" Value="0E-10" Version="1"/>
</Zone>
</Result>
<Result>
<Zone>
<ZoneID>LVLZYKGXAAAH6AAAAFCFIQ5K</ZoneID>
<Name Known="Z1" Value="Z1" Version="1"/>
<Size Known="0E-10" Value="0E-10" Version="20"/>
<Width Known="0E-10" Value="0E-10" Version="20"/>
<RegionID Known="R1" Value="R1" Version="1"/>
<Label Known="Z1" Value="Z1" Version="1"/>
<CropID Known="" Value="" Version="2"/>
<Height Known="0E-10" Value="0E-10" Version="20"/>
</Zone>
</Result>
</Find>FindSensorHubs query : This query will give all the sensor hubs present on the cloud.
Method POST Query <Query>
<Find format="Version,Known">
<MCUModel>
<ID ne="" />
</MCUModel>
</Find>
</Query>Response <Find Format="version,known" Status="Success">
<Result>
<MCUModel>
<ID>LVLUJG7JAAAH6AAAAFWPONLB</ID>
<Label Known="SampleHub" Value="SampleHub" Version="1"/>
<LastUpdated Known="2017-07-09T19:13:54Z" Value="2017-07-09T19:13:54Z" Version="1"/>
<Status Known="Active" Value="Active" Version="1"/>
<HasMetadata Known="true" Value="true" Version="1"/>
<Location>
<longitude Known="-122.462115" Value="-122.462115" Version="1"/>
<latitude Known="37.803829" Value="37.803829" Version="1"/>
</Location>
<ZoneName Known="SampleZone" Value="" Version="2"/>
<Name Known="12345" Value="12345" Version="1"/>
<NextUpdate Known="2017-07-09T19:13:57Z" Value="2017-07-09T19:13:57Z" Version="1"/>
</MCUModel>
</Result>
<Result>
<MCUModel>
<ID>LVLUJKE6AAAH6AAAAHBX5L3F</ID>
<Label Known="fsd" Value="fsd" Version="1"/>
<LastUpdated Known="" Value="" Version="1"/>
<Status Known="" Value="" Version="1"/>
<HasMetadata Known="true" Value="true" Version="1"/>
<Location>
<longitude Known="-122.46133768" Value="-122.46133768" Version="1"/>
<latitude Known="37.80259557" Value="37.80259557" Version="1"/>
</Location>
<ZoneName Known="z1" Value="" Version="1"/>
<Name Known="3333" Value="3333" Version="1"/>
<NextUpdate Known="" Value="" Version="1"/>
</MCUModel>
</Result>
<Result>
<MCUModel>
<ID>LVLUKDZYAAAH6AAAAHEI6YSN</ID>
<Label Known="ss" Value="ss" Version="1"/>
<LastUpdated Known="" Value="" Version="1"/>
<Status Known="" Value="" Version="1"/>
<HasMetadata Known="true" Value="true" Version="1"/>
<Location>
<longitude Known="-122.45794737" Value="-122.45794737" Version="1"/>
<latitude Known="37.80385017" Value="37.80385017" Version="1"/>
</Location>
<ZoneName Known="UnassignedZone" Value="" Version="1"/>
<Name Known="rw" Value="rw" Version="1"/>
<NextUpdate Known="" Value="" Version="1"/>
</MCUModel>
</Result>
</Find>FindZonesAggregateInfo query : This query will give all the calibrated and aggregated sensor values of different zones present on the cloud.
Method POST Query <Query>
<Find>
<ZoneAggregateInfo>
<ID ne="" />
</ZoneAggregateInfo>
</Find>
</Query>Response <Find Status="Success"> <Result> <ZoneAggregateInfo> <ID>LQ3575ZSAAAIWOYNESCZVFVZ</ID> <Time>2017-07-18T23:46:01Z</Time> <ZoneName>SampleZone</ZoneName> <Unit>kPa</Unit> <IsActive>true</IsActive> <MaxValue>300.0000000000</MaxValue> <NAvgValue>264.8313813977</NAvgValue> <MinValue>0E-10</MinValue> <CurrentValue>2537.0000000000</CurrentValue> <SensorName>SoilMoisture1</SensorName> <AvgValue>2541.8847656250</AvgValue> <Count>8665</Count> </ZoneAggregateInfo> </Result> <Result> <ZoneAggregateInfo> <ID>LQ36BZLVAAAIWOYNESE4DBA4</ID> <Time>2017-07-18T23:46:06Z</Time> <ZoneName>SampleZone</ZoneName> <Unit>kPa</Unit> <IsActive>true</IsActive> <MaxValue>300.0000000000</MaxValue> <NAvgValue>69.7872703604</NAvgValue> <MinValue>0E-10</MinValue> <CurrentValue>670.0000000000</CurrentValue> <SensorName>SoilMoisture2</SensorName> <AvgValue>669.8269653320</AvgValue> <Count>8665</Count> </ZoneAggregateInfo> </Result> <Result> <ZoneAggregateInfo> <ID>LUPR36FYAAAIWOYNESCHQKT2</ID> <Time>2017-07-11T17:59:04Z</Time> <ZoneName>SampleZone</ZoneName> <Unit>C</Unit> <IsActive>false</IsActive> <MaxValue>300.0000000000</MaxValue> <NAvgValue>387.5713806152</NAvgValue> <MinValue>0E-10</MinValue> <CurrentValue>215.0000000000</CurrentValue> <SensorName>AirTemperature3</SensorName> <AvgValue>387.5713806152</AvgValue> <Count>2859</Count> </ZoneAggregateInfo> </Result> </Find>
FindZonesAggregateInfoHistory query : This query will give all the calibrated and aggregated sensor values history of different zones present on the cloud. You can use a date filter to get data between the required dates.
Method POST Query <Query>
<Find>
<ZoneAggInfoHistoryModel>
<ID ne=""/>
<RecordDate gt="2017-07-17T00:00:00Z" />
<RecordDate lt="2017-07-17T00:02:00Z" />
</ZoneAggInfoHistoryModel>
</Find>
</Query>Response <Find Status="Success"> <Result> <ZoneAggInfoHistoryModel> <ID>LVG5QTB2AAAIWOYNERTLUKCV</ID> <IsActive>true</IsActive> <ZoneName>SampleZone</ZoneName> <Unit>kPa</Unit> <RecordDate>2017-07-17T00:00:07Z</RecordDate> <MaxValue>300.0000000000</MaxValue> <NAvgValue>264.8295288086</NAvgValue> <SensorName>SoilMoisture1</SensorName> <AvgValue>2541.8669433594</AvgValue> <MinValue>0E-10</MinValue> </ZoneAggInfoHistoryModel> </Result> <Result> <ZoneAggInfoHistoryModel> <ID>LVG5QWWEAAAIWOYNERFRPQVA</ID> <IsActive>true</IsActive> <ZoneName>SampleZone</ZoneName> <Unit>kPa</Unit> <RecordDate>2017-07-17T00:00:10Z</RecordDate> <MaxValue>300.0000000000</MaxValue> <NAvgValue>69.9280319214</NAvgValue> <SensorName>SoilMoisture2</SensorName> <AvgValue>671.1779785156</AvgValue> <MinValue>0E-10</MinValue> </ZoneAggInfoHistoryModel> </Result> <Result> <ZoneAggInfoHistoryModel> <ID>LVG5SKGEAAAIWOYNEQ2WXW4D</ID> <IsActive>true</IsActive> <ZoneName>SampleZone</ZoneName> <Unit>kPa</Unit> <RecordDate>2017-07-17T00:01:03Z</RecordDate> <MaxValue>300.0000000000</MaxValue> <NAvgValue>264.8295593262</NAvgValue> <SensorName>SoilMoisture1</SensorName> <AvgValue>2541.8674316406</AvgValue> <MinValue>0E-10</MinValue> </ZoneAggInfoHistoryModel> </Result> <Result> <ZoneAggInfoHistoryModel> <ID>LVG5SMRPAAAIWOYNERRVFBN4</ID> <IsActive>true</IsActive> <ZoneName>SampleZone</ZoneName> <Unit>kPa</Unit> <RecordDate>2017-07-17T00:01:06Z</RecordDate> <MaxValue>300.0000000000</MaxValue> <NAvgValue>69.9274444580</NAvgValue> <SensorName>SoilMoisture2</SensorName> <AvgValue>671.1724243164</AvgValue> <MinValue>0E-10</MinValue> </ZoneAggInfoHistoryModel> </Result> </Find>