You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by wi...@apache.org on 2020/08/31 19:09:20 UTC

[incubator-streampipes-extensions] branch dev updated: [STREAMPIPES-216] add machine data simulator

This is an automated email from the ASF dual-hosted git repository.

wiener pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes-extensions.git


The following commit(s) were added to refs/heads/dev by this push:
     new 1de365a  [STREAMPIPES-216] add machine data simulator
     new a9b2766  Merge remote-tracking branch 'refs/remotes/origin/dev' into dev
1de365a is described below

commit 1de365a2b4602b0e8547149fe565139c30bd88da
Author: Patrick Wiener <wi...@fzi.de>
AuthorDate: Mon Aug 31 21:08:15 2020 +0200

    [STREAMPIPES-216] add machine data simulator
---
 .../streampipes/connect/ConnectAdapterInit.java    |   6 +-
 .../simulator/machine/MachineDataSimulator.java    | 155 +++++++++++++++++++++
 .../machine/MachineDataSimulatorUtils.java         | 152 ++++++++++++++++++++
 .../machine/MachineDataStreamAdapter.java          |  93 +++++++++++++
 .../{ => random}/RandomDataSetAdapter.java         |   2 +-
 .../{ => random}/RandomDataSimulator.java          |   2 +-
 .../{ => random}/RandomDataSimulatorUtils.java     |   2 +-
 .../{ => random}/RandomDataStreamAdapter.java      |   2 +-
 .../documentation.md                               |  34 +++++
 .../icon.png                                       | Bin 0 -> 31009 bytes
 .../strings.en                                     |   8 ++
 11 files changed, 450 insertions(+), 6 deletions(-)

diff --git a/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/ConnectAdapterInit.java b/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/ConnectAdapterInit.java
index 3c5b1d5..6897963 100644
--- a/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/ConnectAdapterInit.java
+++ b/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/ConnectAdapterInit.java
@@ -25,6 +25,7 @@ import org.apache.streampipes.connect.adapters.flic.FlicMQTTAdapter;
 import org.apache.streampipes.connect.adapters.netio.NetioMQTTAdapter;
 import org.apache.streampipes.connect.adapters.netio.NetioRestAdapter;
 import org.apache.streampipes.connect.adapters.plc4x.modbus.Plc4xModbusAdapter;
+import org.apache.streampipes.connect.adapters.simulator.machine.MachineDataStreamAdapter;
 import org.apache.streampipes.connect.adapters.ti.TISensorTag;
 import org.apache.streampipes.connect.protocol.set.HttpProtocol;
 import org.apache.streampipes.connect.adapters.coindesk.CoindeskBitcoinAdapter;
@@ -38,8 +39,8 @@ import org.apache.streampipes.connect.adapters.mysql.MySqlStreamAdapter;
 import org.apache.streampipes.connect.adapters.opcua.OpcUaAdapter;
 import org.apache.streampipes.connect.adapters.plc4x.s7.Plc4xS7Adapter;
 import org.apache.streampipes.connect.adapters.ros.RosBridgeAdapter;
-import org.apache.streampipes.connect.adapters.simulator.RandomDataSetAdapter;
-import org.apache.streampipes.connect.adapters.simulator.RandomDataStreamAdapter;
+import org.apache.streampipes.connect.adapters.simulator.random.RandomDataSetAdapter;
+import org.apache.streampipes.connect.adapters.simulator.random.RandomDataStreamAdapter;
 import org.apache.streampipes.connect.adapters.slack.SlackAdapter;
 import org.apache.streampipes.connect.adapters.wikipedia.WikipediaEditedArticlesAdapter;
 import org.apache.streampipes.connect.adapters.wikipedia.WikipediaNewArticlesAdapter;
@@ -79,6 +80,7 @@ public class ConnectAdapterInit extends AdapterWorkerContainer {
             .add(new MySqlSetAdapter())
             .add(new RandomDataSetAdapter())
             .add(new RandomDataStreamAdapter())
+            .add(new MachineDataStreamAdapter())
             .add(new SlackAdapter())
             .add(new WikipediaEditedArticlesAdapter())
             .add(new WikipediaNewArticlesAdapter())
diff --git a/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/simulator/machine/MachineDataSimulator.java b/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/simulator/machine/MachineDataSimulator.java
new file mode 100644
index 0000000..86ff8cd
--- /dev/null
+++ b/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/simulator/machine/MachineDataSimulator.java
@@ -0,0 +1,155 @@
+package org.apache.streampipes.connect.adapters.simulator.machine;/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+import org.apache.streampipes.connect.adapter.exception.AdapterException;
+import org.apache.streampipes.connect.adapter.model.pipeline.AdapterPipeline;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class MachineDataSimulator implements Runnable {
+
+    private final AdapterPipeline adapterPipeline;
+    private final Integer waitTimeMs;
+    private final String selectedSimulatorOption;
+
+    private Boolean running;
+
+    public MachineDataSimulator(AdapterPipeline adapterPipeline, Integer waitTimeMs, String selectedSimulatorOption) {
+        this.adapterPipeline = adapterPipeline;
+        this.waitTimeMs = waitTimeMs;
+        this.selectedSimulatorOption = selectedSimulatorOption;
+        this.running = true;
+    }
+
+    @Override
+    public void run() {
+        this.running = true;
+        Map<String, Object> event = new HashMap<>();
+        long startTimeMs = System.currentTimeMillis();
+
+        while (running) {
+            long currentTimeMs = System.currentTimeMillis();
+            long timeDeltaMs = currentTimeMs - startTimeMs;
+
+            switch(this.selectedSimulatorOption) {
+                case "flowrate":
+                    // 0 - 30s
+                    if (timeDeltaMs > 0 && timeDeltaMs <= 30000) {
+                        event = buildFlowrateEvent(0);
+                    }
+                    // 30s - 60s
+                    else if (timeDeltaMs > 30000 && timeDeltaMs <= 60000) {
+                        event = buildFlowrateEvent(1);
+                    }
+                    // > 60s
+                    else {
+                        // reset start time to start over again
+                        startTimeMs = currentTimeMs;
+                    }
+                    break;
+                case "pressure":
+                    // 0 - 30s
+                    if (timeDeltaMs > 0 && timeDeltaMs <= 30000) {
+                        event = buildPressureEvent(0);
+                    }
+                    // 30s - 60s
+                    else if (timeDeltaMs > 30000 && timeDeltaMs <= 60000) {
+                        event = buildPressureEvent(1);
+                    }
+                    // > 60s
+                    else {
+                        // reset start time to start over again
+                        startTimeMs = currentTimeMs;
+                    }
+                    break;
+                case "waterlevel":
+                    // 0 - 30s
+                    if (timeDeltaMs > 0 && timeDeltaMs <= 30000) {
+                        event = buildWaterlevelEvent(0);
+                    }
+                    // 30s - 60s
+                    else if (timeDeltaMs > 30000 && timeDeltaMs <= 60000) {
+                        event = buildWaterlevelEvent(1);
+                    }
+                    // > 60s
+                    else {
+                        // reset start time to start over again
+                        startTimeMs = currentTimeMs;
+                    }
+                    break;
+                default:
+                    try {
+                        throw new AdapterException("resource not found");
+                    } catch (AdapterException e) {
+                        e.printStackTrace();
+                    }
+            }
+
+            adapterPipeline.process(event);
+
+            try {
+                Thread.sleep(waitTimeMs);
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    private Map<String, Object> buildFlowrateEvent(int simulationPhase) {
+        Map<String, Object> event = new HashMap<>();
+
+        event.put("timestamp", System.currentTimeMillis());
+        event.put("sensorId", "flowrate02");
+        event.put("mass_flow", randomDoubleBetween(0,10));
+        event.put("volume_flow", randomDoubleBetween(0,10));
+        event.put("temperature", simulationPhase == 0 ? randomDoubleBetween(40,50) : randomDoubleBetween(80,100));
+        event.put("density", randomDoubleBetween(40,50));
+        event.put("sensor_fault_flags", simulationPhase != 0);
+
+        return event;
+    }
+
+    private Map<String, Object> buildPressureEvent(int simulationPhase) {
+        Map<String, Object> event = new HashMap<>();
+
+        event.put("timestamp", System.currentTimeMillis());
+        event.put("sensorId", "pressure01");
+        event.put("pressure", simulationPhase == 0 ? randomDoubleBetween(10,40) : randomDoubleBetween(40,70));
+
+        return event;
+    }
+
+    private Map<String, Object> buildWaterlevelEvent(int simulationPhase) {
+        Map<String, Object> event = new HashMap<>();
+
+        event.put("timestamp", System.currentTimeMillis());
+        event.put("sensorId", "level01");
+        event.put("level", simulationPhase == 0 ? randomDoubleBetween(20,30) : randomDoubleBetween(60,80));
+        event.put("overflow", simulationPhase != 0);
+
+        return event;
+    }
+
+    private double randomDoubleBetween(int min, int max) {
+        return Math.random() * (max - min + 1) + min;
+    }
+
+    public void setRunning(Boolean running) {
+        this.running = running;
+    }
+}
diff --git a/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/simulator/machine/MachineDataSimulatorUtils.java b/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/simulator/machine/MachineDataSimulatorUtils.java
new file mode 100644
index 0000000..95bf9cf
--- /dev/null
+++ b/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/simulator/machine/MachineDataSimulatorUtils.java
@@ -0,0 +1,152 @@
+package org.apache.streampipes.connect.adapters.simulator.machine;/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+import org.apache.streampipes.connect.adapter.exception.AdapterException;
+import org.apache.streampipes.model.connect.guess.GuessSchema;
+import org.apache.streampipes.model.schema.PropertyScope;
+import org.apache.streampipes.sdk.builder.PrimitivePropertyBuilder;
+import org.apache.streampipes.sdk.builder.adapter.GuessSchemaBuilder;
+import org.apache.streampipes.sdk.utils.Datatypes;
+import org.apache.streampipes.vocabulary.SO;
+
+import java.net.URI;
+
+import static org.apache.streampipes.sdk.helpers.EpProperties.*;
+
+public class MachineDataSimulatorUtils {
+
+    // Vocabulary
+    public static final String NS = "https://streampipes.org/vocabulary/examples/watertank/v1/";
+    public static final String HAS_SENSOR_ID = NS + "hasSensorId";
+
+    private static final String TIMESTAMP = "timestamp";
+    private static final String SENSOR_ID = "sensorId";
+    private static final String MASS_FLOW = "mass_flow";
+    private static final String TEMPERATURE = "temperature";
+
+    public static GuessSchema getSchema(String selectedSimulatorOption) throws AdapterException {
+        switch(selectedSimulatorOption) {
+            case "flowrate":
+                return getFlowrateSchema();
+            case "pressure":
+                return getPressureSchema();
+            case "waterlevel":
+                return getWaterlevelSchema();
+            default:
+                throw new AdapterException("resource not found");
+        }
+    }
+
+    private static GuessSchema getWaterlevelSchema() {
+        return GuessSchemaBuilder.create()
+                .property(timestampProperty(TIMESTAMP))
+                .property(PrimitivePropertyBuilder
+                        .create(Datatypes.String, "sensorId")
+                        .label("Sensor ID")
+                        .description("The ID of the sensor")
+                        .domainProperty(HAS_SENSOR_ID)
+                        .scope(PropertyScope.DIMENSION_PROPERTY)
+                        .build())
+                .property(PrimitivePropertyBuilder
+                        .create(Datatypes.Float, "level")
+                        .label("Water Level")
+                        .description("Denotes the current water level in the container")
+                        .domainProperty(SO.Number)
+                        .scope(PropertyScope.MEASUREMENT_PROPERTY)
+                        .build())
+                .property(PrimitivePropertyBuilder
+                        .create(Datatypes.Boolean, "overflow")
+                        .label("Overflow")
+                        .description("Indicates whether the tank overflows")
+                        .domainProperty(SO.Number)
+                        .scope(PropertyScope.MEASUREMENT_PROPERTY)
+                        .build())
+                .build();
+    }
+
+    private static GuessSchema getPressureSchema() {
+        return GuessSchemaBuilder.create()
+                .property(timestampProperty(TIMESTAMP))
+                .property(PrimitivePropertyBuilder
+                        .create(Datatypes.String, "sensorId")
+                        .label("Sensor ID")
+                        .description("The ID of the sensor")
+                        .domainProperty(HAS_SENSOR_ID)
+                        .scope(PropertyScope.DIMENSION_PROPERTY)
+                        .build())
+                .property(PrimitivePropertyBuilder
+                        .create(Datatypes.Float, "pressure")
+                        .label("Pressure")
+                        .description("Denotes the current pressure in the pressure tank")
+                        .domainProperty(SO.Number)
+                        .valueSpecification(0.0f, 100.0f, 0.5f)
+                        .scope(PropertyScope.MEASUREMENT_PROPERTY)
+                        .build())
+                .build();
+    }
+
+    public static GuessSchema getFlowrateSchema() {
+        return GuessSchemaBuilder.create()
+                .property(timestampProperty(TIMESTAMP))
+                .property(PrimitivePropertyBuilder
+                        .create(Datatypes.String, SENSOR_ID)
+                        .label("Sensor ID")
+                        .description("The ID of the sensor")
+                        .domainProperty(HAS_SENSOR_ID)
+                        .scope(PropertyScope.DIMENSION_PROPERTY)
+                        .build())
+                .property(PrimitivePropertyBuilder
+                        .create(Datatypes.Float, MASS_FLOW)
+                        .label("Mass Flow")
+                        .description("Denotes the current mass flow in the sensor")
+                        .domainProperty(SO.Number)
+                        .scope(PropertyScope.MEASUREMENT_PROPERTY)
+                        .build())
+                .property(PrimitivePropertyBuilder
+                        .create(Datatypes.Float, "volume_flow")
+                        .label("Volume Flow")
+                        .description("Denotes the current volume flow")
+                        .domainProperty(SO.Number)
+                        .scope(PropertyScope.MEASUREMENT_PROPERTY)
+                        .build())
+                .property(PrimitivePropertyBuilder
+                        .create(Datatypes.Float, TEMPERATURE)
+                        .label("Temperature")
+                        .description("Denotes the current temperature in degrees celsius")
+                        .domainProperty(SO.Number)
+                        .scope(PropertyScope.MEASUREMENT_PROPERTY)
+                        .measurementUnit(URI.create("http://codes.wmo.int/common/unit/degC"))
+                        .valueSpecification(0.0f, 100.0f, 0.1f)
+                        .build())
+                .property(PrimitivePropertyBuilder
+                        .create(Datatypes.Float, "density")
+                        .label("Density")
+                        .description("Denotes the current density of the fluid")
+                        .domainProperty(SO.Number)
+                        .scope(PropertyScope.MEASUREMENT_PROPERTY)
+                        .build())
+                .property(PrimitivePropertyBuilder
+                        .create(Datatypes.Float, "sensor_fault_flags")
+                        .label("Sensor Fault Flags")
+                        .description("Any fault flags of the sensors")
+                        .domainProperty(SO.Number)
+                        .scope(PropertyScope.MEASUREMENT_PROPERTY)
+                        .build())
+                .build();
+    }
+}
diff --git a/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/simulator/machine/MachineDataStreamAdapter.java b/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/simulator/machine/MachineDataStreamAdapter.java
new file mode 100644
index 0000000..bf744f3
--- /dev/null
+++ b/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/simulator/machine/MachineDataStreamAdapter.java
@@ -0,0 +1,93 @@
+package org.apache.streampipes.connect.adapters.simulator.machine;/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+import org.apache.streampipes.connect.adapter.Adapter;
+import org.apache.streampipes.connect.adapter.exception.AdapterException;
+import org.apache.streampipes.connect.adapter.exception.ParseException;
+import org.apache.streampipes.connect.adapter.model.specific.SpecificDataStreamAdapter;
+import org.apache.streampipes.model.AdapterType;
+import org.apache.streampipes.model.connect.adapter.SpecificAdapterStreamDescription;
+import org.apache.streampipes.model.connect.guess.GuessSchema;
+import org.apache.streampipes.sdk.builder.adapter.SpecificDataStreamAdapterBuilder;
+import org.apache.streampipes.sdk.extractor.StaticPropertyExtractor;
+import org.apache.streampipes.sdk.helpers.Labels;
+import org.apache.streampipes.sdk.helpers.Locales;
+import org.apache.streampipes.sdk.helpers.Options;
+import org.apache.streampipes.sdk.utils.Assets;
+
+import java.util.ArrayList;
+
+public class MachineDataStreamAdapter extends SpecificDataStreamAdapter {
+
+    public static final String ID = "org.apache.streampipes.connect.adapters.simulator.machine";
+    private static final String WAIT_TIME_MS = "wait-time-ms";
+    private static final String SELECTED_SIMULATOR_OPTION = "selected-simulator-option";
+
+    private String selectedSimulatorOption = "";
+
+    private MachineDataSimulator machineDataSimulator;
+
+    public MachineDataStreamAdapter() {
+    }
+
+    public MachineDataStreamAdapter(SpecificAdapterStreamDescription adapterStreamDescription) {
+        super(adapterStreamDescription);
+        StaticPropertyExtractor extractor = StaticPropertyExtractor.from(adapterStreamDescription.getConfig(), new ArrayList<>());
+        Integer waitTimeMs = extractor.singleValueParameter(WAIT_TIME_MS, Integer.class);
+        this.selectedSimulatorOption = extractor.selectedSingleValue(SELECTED_SIMULATOR_OPTION, String.class);
+        this.machineDataSimulator = new MachineDataSimulator(adapterPipeline, waitTimeMs, selectedSimulatorOption);
+    }
+
+    @Override
+    public SpecificAdapterStreamDescription declareModel() {
+        return SpecificDataStreamAdapterBuilder.create(ID)
+                .withAssets(Assets.DOCUMENTATION, Assets.ICON)
+                .withLocales(Locales.EN)
+                .category(AdapterType.Debugging)
+                .requiredIntegerParameter(Labels.withId(WAIT_TIME_MS))
+                .requiredSingleValueSelection(Labels.withId(SELECTED_SIMULATOR_OPTION), Options.from(
+                        "flowrate", "pressure", "waterlevel"))
+                .build();
+    }
+
+    @Override
+    public void startAdapter() throws AdapterException {
+        Thread thread = new Thread(this.machineDataSimulator);
+        thread.start();
+    }
+
+    @Override
+    public void stopAdapter() throws AdapterException {
+        this.machineDataSimulator.setRunning(false);
+    }
+
+    @Override
+    public Adapter getInstance(SpecificAdapterStreamDescription adapterStreamDescription) {
+        return new MachineDataStreamAdapter(adapterStreamDescription);
+    }
+
+    @Override
+    public GuessSchema getSchema(SpecificAdapterStreamDescription adapterStreamDescription) throws AdapterException, ParseException {
+        return MachineDataSimulatorUtils.getSchema(this.selectedSimulatorOption);
+    }
+
+    @Override
+    public String getId() {
+        return ID;
+    }
+}
diff --git a/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/simulator/RandomDataSetAdapter.java b/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/simulator/random/RandomDataSetAdapter.java
similarity index 98%
rename from streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/simulator/RandomDataSetAdapter.java
rename to streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/simulator/random/RandomDataSetAdapter.java
index fa68270..c96529b 100644
--- a/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/simulator/RandomDataSetAdapter.java
+++ b/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/simulator/random/RandomDataSetAdapter.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  *
  */
-package org.apache.streampipes.connect.adapters.simulator;
+package org.apache.streampipes.connect.adapters.simulator.random;
 
 import org.apache.streampipes.connect.adapter.Adapter;
 import org.apache.streampipes.connect.adapter.exception.AdapterException;
diff --git a/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/simulator/RandomDataSimulator.java b/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/simulator/random/RandomDataSimulator.java
similarity index 97%
rename from streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/simulator/RandomDataSimulator.java
rename to streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/simulator/random/RandomDataSimulator.java
index bce4c60..a64cb3b 100644
--- a/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/simulator/RandomDataSimulator.java
+++ b/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/simulator/random/RandomDataSimulator.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  *
  */
-package org.apache.streampipes.connect.adapters.simulator;
+package org.apache.streampipes.connect.adapters.simulator.random;
 
 import org.apache.streampipes.connect.adapter.model.pipeline.AdapterPipeline;
 
diff --git a/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/simulator/RandomDataSimulatorUtils.java b/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/simulator/random/RandomDataSimulatorUtils.java
similarity index 96%
rename from streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/simulator/RandomDataSimulatorUtils.java
rename to streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/simulator/random/RandomDataSimulatorUtils.java
index 98bce40..2d6693b 100644
--- a/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/simulator/RandomDataSimulatorUtils.java
+++ b/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/simulator/random/RandomDataSimulatorUtils.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  *
  */
-package org.apache.streampipes.connect.adapters.simulator;
+package org.apache.streampipes.connect.adapters.simulator.random;
 
 import org.apache.streampipes.model.connect.guess.GuessSchema;
 import org.apache.streampipes.sdk.builder.adapter.GuessSchemaBuilder;
diff --git a/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/simulator/RandomDataStreamAdapter.java b/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/simulator/random/RandomDataStreamAdapter.java
similarity index 98%
rename from streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/simulator/RandomDataStreamAdapter.java
rename to streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/simulator/random/RandomDataStreamAdapter.java
index 1c1116a..7aea441 100644
--- a/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/simulator/RandomDataStreamAdapter.java
+++ b/streampipes-connect-adapters/src/main/java/org/apache/streampipes/connect/adapters/simulator/random/RandomDataStreamAdapter.java
@@ -15,7 +15,7 @@
  * limitations under the License.
  *
  */
-package org.apache.streampipes.connect.adapters.simulator;
+package org.apache.streampipes.connect.adapters.simulator.random;
 
 import org.apache.streampipes.connect.adapter.Adapter;
 import org.apache.streampipes.connect.adapter.exception.AdapterException;
diff --git a/streampipes-connect-adapters/src/main/resources/org.apache.streampipes.connect.adapters.simulator.machine/documentation.md b/streampipes-connect-adapters/src/main/resources/org.apache.streampipes.connect.adapters.simulator.machine/documentation.md
new file mode 100644
index 0000000..ec3ed05
--- /dev/null
+++ b/streampipes-connect-adapters/src/main/resources/org.apache.streampipes.connect.adapters.simulator.machine/documentation.md
@@ -0,0 +1,34 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~    http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  ~
+  -->
+
+## Machine Data Simulator
+
+<p align="center"> 
+    <img src="icon.png" width="150px;" class="pe-image-documentation"/>
+</p>
+
+***
+
+## Description
+
+Publishes various simulated machine sensor data in a configurable time interval (in milliseconds).
+Sensors are:
+* flowrate
+* pressure
+* waterlevel
+***
\ No newline at end of file
diff --git a/streampipes-connect-adapters/src/main/resources/org.apache.streampipes.connect.adapters.simulator.machine/icon.png b/streampipes-connect-adapters/src/main/resources/org.apache.streampipes.connect.adapters.simulator.machine/icon.png
new file mode 100644
index 0000000..33c09c4
Binary files /dev/null and b/streampipes-connect-adapters/src/main/resources/org.apache.streampipes.connect.adapters.simulator.machine/icon.png differ
diff --git a/streampipes-connect-adapters/src/main/resources/org.apache.streampipes.connect.adapters.simulator.machine/strings.en b/streampipes-connect-adapters/src/main/resources/org.apache.streampipes.connect.adapters.simulator.machine/strings.en
new file mode 100644
index 0000000..a9e8b06
--- /dev/null
+++ b/streampipes-connect-adapters/src/main/resources/org.apache.streampipes.connect.adapters.simulator.machine/strings.en
@@ -0,0 +1,8 @@
+org.apache.streampipes.connect.adapters.simulator.machine.title=Machine Data Simulator
+org.apache.streampipes.connect.adapters.simulator.machine.description=Publishes various simulated machine sensor data
+
+wait-time-ms.title=Wait Time (MS)
+wait-time-ms.description=The time to wait between two events in milliseconds
+
+selected-simulator-option.title=Select sensor
+selected-simulator-option.description=Select simulated sensor data to be published
\ No newline at end of file