0

We are building an application upon "APS DataViz Extensions Demo" and we've run into a problem for having different sensor types in one room, as shown in "original_heatmap.PNG". In summary, we have two sensor types: 1. ENV sensors including Temperature, CO2, and Humidity channels information, and 2: PPL sensors including PplCounter channel.information only. The current SensorHeatMap extension returns 0.00 for sensor values that do not have information for a specific chosen channel, as shown in "original_heatmap.PNG", in which, PPL sensor is showing 0.00 on the heatmap in case the Temperature channel is selected. Following, the documentation for "renderSurfaceShading(nodeIds, sensorType, valueCallback, options)" and "SensorValueCallback" we changed the return value to NaN so that "the sensor will have no influence in the resulting heatmap color (it is as though the sensor did not exist).". However, we are receiving 0.00 across all of our sensors in all of the selected channels, as shown in "NaN_heatmap.PNG". As a result, we'd appreciate any help and assistance for dealing with this problem. Also, other tips for incorporating multiple sensor types in one model is much appreciated. Original code for dataviz heatmap Heatmap after returning NaN in SensorHeatmapExtension

1 Answers1

0

Thank you for the heads up. I've updated the SensorHeatmapsExtension so that when no sensor data is available, Number.NaN is returned: https://github.com/autodesk-platform-services/aps-iot-extensions-demo/commit/b3e9018f603fecf57601d8c17d2610d62aef23d9.

After this update, the heatmaps are behaving as expected, i.e., sensors that don't have relevant data are not contributing to the heatmap in any way.

EDIT: in case you actually need your sensor data to "fall off faster", you'll need to tweak the heatmapConfig.confidence value. I've made another update to the SensorHeatmapsExtension to indicate the possible settings: https://github.com/autodesk-platform-services/aps-iot-extensions-demo/commit/ed64c238fa5e6330743235b3e08fcecac8bcb42d.

Petr Broz
  • 8,891
  • 2
  • 15
  • 24
  • Thanks a lot @Petr Broz. Just a couple of notes regarding this new code: 1. I noticed returning NaN only works when different sensors are affecting different objects. When we have different sensors on one object, returning NaN somehow affects the normalization part of the getSensorValue function resulting in showing the minimum value for all of the sensors with valid values. I tried returning -1 and it is working as intended now. – Kaveh Mirzaei Mar 11 '23 at 21:51
  • 2) The config options is an awesome addition to this extension. I just noticed that it was not working for me after changing the values. I had a look at the heatmap option documentations and I noticed that it should be added to setupSurfaceShading not renderSurfaceShading. After changing that, I noticed that it was working as intended. – Kaveh Mirzaei Mar 11 '23 at 21:55
  • 3) This may not be a part of this question but I am having difficulty applying two heatmaps on top of each other. These two heatmaps are from different sensor types so one of them will always be blank. The problem is that the top heatmap always covers the below heatmap and even when it has no valid samples, it shows a blank heatmap. Do you have any suggestions for how to remove this blank heatmap for sensors without valid samples (or having null samples) based on the selected channel? – Kaveh Mirzaei Mar 11 '23 at 22:04
  • Thank you for the feedback. Btw feel free to create GitHub issues or submit PRs to the sample repo for us to review. – Petr Broz Mar 14 '23 at 09:38
  • Regarding #3, I'm not sure I understand. The sample app does not support overlaying multiple heatmaps on top of each other. It'll always only show one heatmap based on the selected channel. – Petr Broz Mar 14 '23 at 09:40