aws-solutions / iot-device-simulator

The IoT Device Simulator solution is a Graphical User Interface (GUI) based engine designed to enable customers to get started quickly assessing AWS IoT services without an existing pool of devices. The IoT Device Simulator helps effortlessly create and simulate thousands of connected devices that are defined by the customer.
https://aws.amazon.com/solutions/implementations/iot-device-simulator/
Apache License 2.0
160 stars 83 forks source link

Device type transmission interval/duration are not flexible enough. #3

Closed ms-schneider-electric closed 1 year ago

ms-schneider-electric commented 6 years ago

I am creating a new device type and the transmission interval/duration do not support the scenario I am trying to configure the device type for.

e.g. I want to create a thermostat that sends the temp/humidity/occupancy once a minute.

With the current configuration constraints I cannot do that, nor is it clear how I would do that with these settings. Even if I could set the duration to 1 ms it is not clear that I would only get 1 data point for the interval.

The current settings seem aimed at bursting data at regular intervals for a period of time, but not generating a fixed set of data at regular intervals, which is my use case.

shsenior commented 6 years ago

Can you expand your requirement to "generate a fixed set of data at regular intervals"? Possibly provide an example payload you want to transmit and at what regular interval you wish to send it. Also, can you share the device type record you created from the 'iot-sim-device-type' DynamoDB table?

ms-schneider-electric commented 6 years ago

My use case is the following:

As a hypothetical use case, create a “Thermostat” as the device type you are connecting. The idea here would be to have the device update something like:
    · [Config/Shadow] Mode – Off, Heat , Cool – periodically  
    · [Config/Shadow] The HVAC System Active – true or false – changing periodically, ideally more often than the mode.
    · [Config/Shadow] The Desired Temperature - 
    · [Telemetry] The current:   - Communicated every minute The values should fluxuate.
            o Temperature
            o Humidity
            o Occupancy 

Ideally there would be two modes set on the shadow – full shadow usage – when true all device changes, including telemetry, go through the shadow. When false, only configuration is updated in the shadow and telemetry through a custom topic. A Shadow update of this attribute should change how the device communicates.

The device type I have created so far to try as part of this exercise is the following, though I am still trying to understand how best to configure the device type to achieve this use case:

{
  "createdAt": "2018-07-25T15:46:50Z",
  "custom": true,
  "name": "Thermostat",
  "spec": {
    "duration": 60000,
    "interval": 60000,
    "payload": [
      {
        "_id_": "rJ3WiGUEm",
        "max": 100,
        "min": 50,
        "name": "Temperature",
        "type": "int"
      },
      {
        "_id_": "HJgEjGIE7",
        "max": 100,
        "min": 50,
        "name": "Humidity",
        "type": "int"
      },
      {
        "_id_": "ByYdifIVm",
        "max": 25,
        "min": 0,
        "name": "Occupancy",
        "type": "int"
      }
    ],
    "topic": "/thermostat/telemetry"
  },
  "typeId": "HJfdofUEX",
  "updatedAt": "2018-07-25T15:47:18Z",
  "userId": "I removed this"
}
shsenior commented 6 years ago

I understand. This is a good use case we will put into our backlog. We are always looking to improve the baseline feature set.

Currently, the simulator does not provision Things in AWS IoT. It is really designed at this point to evaluate backend IoT applications that gather, process, analyze and act on data generated by connected devices. As you mentioned, it does burst data at regular intervals for a period of time to be able to quickly evaluate analytics applications, business logic, routing engine, etc.

We have not tested updating shadow states, but if you have an existing shadow, you should be able to publish a state document to the $aws/things/thingName/shadow/update topic from the simulator to modify the shadow. We will dig into this more.

As it currently stands, you can configure it to send the telemetry outlined above every minute for x number of minutes. As currently configured, this would only send one value because the duration === interval values.

Thanks for the feedback.

ms-schneider-electric commented 6 years ago

Thanks.

It would be great to be able to drive all this from the Device Simulator (provisioning things, sending/receiving shadow notifcations, sending telemetry, inserting custom logic, etc...).... This would really make the device simulator a well-rounded IOT simulation platform.

Keep me posted on how/if we can send shadow updates from a device. Right now just from looking at what is available in the UI it doesn't seem possible, so I assume this would be some sort of hack to make it happen.

Do you have any recommendation to achieve our simulation use case (with or without the IOT Device Simulator).

fhoueto-amz commented 1 year ago

Hi @ms-schneider-electric This enhancement did not receive enough support to be added to the roadmap, as a result, I am closing it for now. You may reopen the request in the future or create a new request linking to this one if you would like the decision reevaluated. Rgds Fabien