Splitting Payload of Device

Hello,

How I can Split the payloads to represent how many times a Button pressed in one month.

I want to use the pie Chart, to Show different States.

Thanks

Fabian

Hi,

To represent how many times a button has been pressed in one month using a Pie Chart on TagoIO, you will need to follow these steps:

1. Collect Button Press Data:

  • Ensure that your IoT device is configured to send an event to TagoIO each time the button is pressed.

  • The event data should include a timestamp and a variable that indicates a button press.

2. Create Variables for Each State:

  • If the button has different states (e.g., on/off), you should have a variable for each state that increments every time the button is pressed in that particular state.

3. Set Up an Analysis:

  • Write an Analysis script that runs periodically (e.g., at the end of each month) to count the number of button presses for each state within the month.

  • The Analysis should split the payload data based on the timestamp to ensure it only counts events within the desired month.

  • After counting, the Analysis should store the results in separate variables, one for each state.

4. Configure the Pie Chart Widget:

  • Go to your dashboard and select the Pie widget from the list of available widgets.

  • Customize the widget using the options on the right side.

  • In the ‘Data From’ field, specify the device and select the variables that represent the count of button presses for each state.

  • If you are using a Normal Dashboard, choose the device and select the corresponding variables for ‘Data From’.

  • If you are using a Blueprint Dashboard, add a Blueprint device and provide the name of the variables for ‘Data From’.

5. Display the Data:

  • The Pie Chart will automatically generate slices based on the data from the variables you have selected.

  • Each slice will represent the number of times the button was pressed in a particular state for the month.

6. Schedule the Analysis:

  • Schedule the Analysis to run at the end of each month to update the variables with the latest counts.

By following these steps, you will have a Pie Chart on your TagoIO dashboard that shows the different states of the button presses over the course of one month. Remember that the Analysis script is crucial for processing the raw data into a format that can be easily visualized by the Pie Chart widget.

Oh no, why its so complicated :smiley:

If I download the CSV of all Payloads and use excel, I get the result in less than 3min :smiley:

Is there no other way, or example??

Thanks Fabian

Hi Fabian,

You can setup an analysis that will go through each devices data and sum the amount of times the button was pressed every month. Then send that amount to a variable that you’ll show in the Pie Widget.

Im not exactly sure I understood what you’re trying to do, can you explain with further details?