New component type
Temperature & Humidity is now available in the Dev Console.
You may be wondering why we have this now where there are already a Temperature and a Humidity components available?
The reason for this type is that it combines both Temp & Humidity values in one, it takes advantage of the newly implemented ChipChop engine data type "value array" that allows storing combined numeric data and provides more efficient data storage and faster data retrieval.
Additional Benefits- Temperature & Humidity usually go together with many environmental sensors so it makes sense to have them as a combined reading
- Saves you from having to sacrifice an additional component (you get 2 for 1)
- Works as a base component for the new AHT1x & AHT2x Code Builder plugin (see next post)
Dev Console setup
You will find the Temperature & Humidity in the list of pre-set components. There is nothing special you need to do, simply select it as a component and there are no additional settings required.
ChipChop App view
In the ChipChop App the component shows combined values and if set as "Interactive mode" you will also have the "Send Command" button next to it. Not entirely sure why you would use it but it's there so maybe you can send a command to reset the sensor or something similar.
UsageThe format of the status you would send from your device has to be an array as a
String, meaning that the values have to be enclosed in square brackets
[ ] Important: 1. The temperature value is the first item in the array and the humidity is second. If you reverse the order it will not be shown correctly in the App or Dev Console
2. The values have to be numbers (int or float)
Example
float temperature = 42.18;
float humidity = 52.10;
String status = "[" + String(temperature) + "," + String(humidity) + "]"; // so it would look like this >>> [42.18,52.10]
ChipChop.updateStatus("sensor_name",status);
LimitationsCurrently there is no option for using this component in an Action trigger IF statement simply because the IF expects a single value and here we have two.
Don't worry, as this will be a standard component I will be expanding the Actions soon and you will be able to use it as any other component.
Hope you will find this new component useful and have a read about the new
AHT Code Builder Plugin in the next post