Process data received from Wago PFC200

Benjamin Ulrich 26 Reputation points
2021-02-06T12:02:26.48+00:00

Hello

Im trying to create a chart from my data received from IoT hub. The Data is generated from a Wago PFC 200 controller.
After struggling for a long time I managed to establish a connection.
this is what my IoT hub receives:

Welcome to Azure Cloud Shell

Type "az" to use Azure CLI
Type "help" to learn about Cloud Shell


MOTD: Manage Azure Active Directory: Get-Command -Module AzureAD*

VERBOSE: Authenticating to Azure ...
VERBOSE: Building your Azure drive ...
PS /home/benjamin> az extension add --name azure-iot
PS /home/benjamin> az iot hub monitor-events --hub-name WagoTestIoThub
Dependency update (uamqp 1.2) required for IoT extension version: 0.10.9.
Continue? (y/n) -> y
Updating required dependency...
Update complete. Executing command...
Starting event monitor, use ctrl-c to stop...


{
    "event": {
        "origin": "WagoTischmodel",
        "module": "",
        "interface": "",
        "component": "",
        "payload": "{\"MessageType\":\"TagConfiguration\",\"WagoProtocol\":\"1.5.0\",\"Complete\":true,\"Collections\":[{\"Id\":0,\"CollectionName\":\"Blog_test\",\"SamplingControl\":\"cloud\",\"SamplingIntervalType\":\"equal\",\"SampleContent\":\"all\",\"SampleRate\":30000,\"PublishInterval\":60000,\"TagData\":[{\"Tag\":\"CPU Temperatur\",\"Unit\":\"\u00b0C\",\"TypeId\":0,\"ValueType\":\"real\"},{\"Tag\":\"Lampa\",\"Unit\":\"\",\"TypeId\":0,\"ValueType\":\"bool\"}]}]}"
    }
}
{
    "event": {
        "origin": "WagoTischmodel",
        "module": "",
        "interface": "",
        "component": "",
        "payload": "{\"MessageType\":\"TagValues\",\"WagoProtocol\":\"1.5.0\",\"CollectionId\":0,\"TagData\":[{\"Time\":\"2021-02-06T10:49:22.145+01:00\",\"Values\":{\"CPU Temperatur\":0.0020000000949949026,\"Lampa\":false}}]}"
    }
}

Now I want to display the "CPU Temperatur" in a chart. how can I do this?

Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,157 questions
0 comments No comments
{count} votes

Accepted answer
  1. Sander van de Velde | MVP 31,211 Reputation points MVP
    2021-02-06T17:02:50.01+00:00

    Hello @Benjamin Ulrich ,

    You are receiving telemetry into the IoT Hub. You are now ready to pass on the incoming telemetry to other services.

    To represent this data in a chart, there are several options:

    As an alternative, You could check out IoT Central.

    Keep in mind, the message you receive is not a 'well-formed' JSON message. The payload is in fact also a JSON message but encoded as a string. This means you normally have to perform an extra transformation after the message arrives in Azure. This can be done eg. with Azure Stream Analytics or an Azure Function.


0 additional answers

Sort by: Most helpful