Community
Tandem Forum
Welcome to Autodesk's Tandem Forum. Please share your knowledge, ask questions, collaborate on ideas, and explore forum topics
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Creating virtual / fictional sensors

4 REPLIES 4
Reply
Message 1 of 5
saNGFVJ
770 Views, 4 Replies

Creating virtual / fictional sensors

Hi, 

 

Does anyone know how to create virtual sensors to simulate an real IoT device before any construction begins?

 

Would be greatly beneficial to map design information to these sensors during the design phase and compare against the real measurements once construction handover is completed. Ideally being able to schedule information sent to Tandem to make full use of heat maps and graphs to present to the client would be great. 

 

Once the virtual sensors are created, hoping that we can do a simple swap between the physical and virtual sensors. 

 

Thanks, 

4 REPLIES 4
Message 2 of 5
derek_milz
in reply to: saNGFVJ

You can utilize the attached python program for simulating the following variables every 15 mins (this assumes your streams are already setup in Tandem, just waiting for data):

 

Name

Min

Max

Units

temperatureF

65.00

72.00

temperatureC

18.33

22.22

Co2

530.00

550.00

ppm

Humidity

30

50

%

Pressure

67.00

75.00

ppm

Room_occupancy

10

20

Persons

Building_occupancy

200

400

Persons

Motor_speed

1000

2000

Rpms

Motor_vibrations

.1

2

m/s²

Motor_frequency

55

60

Hz

Energy_usage

1000

Incremental

kWh

 

1.  Download the attached 'Sim Tandem Variables.txt' and open in a text-editor (such as notepad), perform a 'Save-As', and rename the file/extension to 'Sim Tandem Variables.py'

 

2.  Download Python onto your corresponding OS by going to python.org/downloads and follow the installation instructions.

 

3.  After the Python installation completes, we will also install the HTTP ‘Requests’ library by opening your cmd/terminal and entering:

 

Windows:   

 

 

python -m pip install requests

 

 

MacOS: 

 

 

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py
pip install requests

 

 

 

 

4.  Open ‘Sim Tandem Variables.py’ in Notepad, Text-Editor, or your preferred code-editing tool such as Visual Studio Code.  Add your links from your Tandem Environment in the 'tandem_streams_endpoints' array, being sure to separate each one with a comma: 

 

derek_milz_2-1697482527713.png

 

5.  After updating all your Tandem Stream Links, save the updated changes and run the python program:

  • Windows:          'Right-Click 'Sim Tandem Variables.py' > Open With > Python 3.11 (or current Python Version)
  • MacOS:              'Right-click Sim Tandem Variables.py' > Open With > Python Launcher

Data will start publishing to your Tandem Streams every 15 minutes.  Leave this python program running as long as you want data publishing:

 

derek_milz_3-1697482763994.png

 

***Note, if you upgrade python from previous version and the window flashes and disappears run:

pip install --upgrade requests

 

6.  Feel free to link some or all values that apply to your simulation:

 

derek_milz_4-1697483119853.png

 

 

Message 3 of 5
derek_milz
in reply to: saNGFVJ

There are also multiple options available within the IoT industry to create virtual devices and simulate telemetry data including running code on a local machine, creating an Azure IoT hub and using a mobile device or virtual device as a simulated IoT device (https://www.youtube.com/watch?v=zPEonu_NDnI), or using a specific vendor's device simulation such as Disruptive Technologies Studio (https://www.youtube.com/watch?v=F9pTnHa08W0).

 

Message 4 of 5
saNGFVJ
in reply to: saNGFVJ

Thanks for the comprehensive response, I will get stuck into it and post findings here!

Message 5 of 5
jens.krause
in reply to: saNGFVJ

Hi all.
I tested the script yesterday and it worked smoothly for me except for some minor issues that I wanted to share here:

 

  • If the request library cannot be installed using 'python -m pip install requests', you might want to give 'py -m pip install requests' a try
  • If you update your Python installation AFTER installing the library, you need to update the library, too. Using: 'pip install --upgrade requests'. Otherwise you will not receive the 'Data sent successfully' response when running the script
  • After creating a new connection, it takes a while until the new URL that you can copy becomes available. Please wait several minutes after creating the connection and copying the URL before you try to run the script. Otherwise, you might see a 404 error
  • After running the script, it can take several minutes until the first payload is visible in the connection. You can use 'Refresh' in the three dot menu of the connection to speed up the process


Jens Krause
Autodesk Support Team

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report