New communication methods


My Data DIY now supports more communication types, opening incredible opportunities for visualizing data delivered via a variety of channels of your choice.




  • HTTP Poll: the app will periodically poll an exposed URL on the Internet or a local network for data.
  • HTTP Push: the app needs to be pushed with data using local network URL.
  • MQTT Channel: the app connects to an external MQTT Broker and a particular topic to receive data.
  • Web Socket: the app connects to an external system via web sockets to receive date.



Support of any JSON or XML data structures with no-code


All communication methods, except HTTP Push, support any JSON or XML data structures from the existing data sources. This means that there's no need to transform the existing data source format into a LaMetric-specific one. Now, LaMetric devices can acquire data directly without the need for an intermediary server or writing a single line of code.


For example, on the screens below there is the configuration that gets data from a Shelly Switch by polling its local API Switch.GetStatus endpoint.




Here is an example of the returned JSON:


{
"id": 1,
  "src": "shellyplus1pm-441793ce3f08",
  "params": {
    "id": 0,
    "source": "WS_in",
    "output": false,
    "apower": 0,
    "voltage": 225.9,
    "current": 0,
    "aenergy": {
      "total": 11.5,
      "by_minute": [
        0,
        0,
        0
      ],
      "minute_ts": 1654511972
    },
    "temperature": {
      "tC": 53.3,
      "tF": 127.9
    }
  }
}


My Data DIY app will automatically transform all JSON/XML keys into variables with their related values, as shown in the table below.



JSON/XML key 

My Data DIY variable with a short name

My Data DIY variable using JSON path

Comment

id

{id[0]}

{id}

JSON keys with the same names form an array of short names, and the order in this array corresponds to the order in which the keys appear in the data structure.


id, nested in params object

{id[1]}

{params.id}

src

{src}

{src}


source

{source}

{params.source}

output

{output}

{params.output}

apower

{apower}

{params.apower}

voltage

{voltage}

{params.voltage}

current

{current}

{params.current}

total

{total}

{params.aenergy.total}

minute_ts

{minute_ts}

{params.minute_ts}

tC

{tC}

{params.temperature.tC}

tF

{tF}

{params.temperature.tF}

by_minute

N/A


JSON keys with array values are ignored



You can use either short variable names or names based on the JSON path.


Also, My Data DIY app supports variables with math expressions.


My Data DIY variables with math expressions
Comment
{apower * 0.15}
Variable with a short name is used in the math expression
{params.temperature.tC + 1)
Variable with JSON path name is used in the math expression
{voltage*current / 1000}
Variables with short names are used in the math expression


Also, My Data DIY app supports the following default variables.


My Data DIY default variableComment
{#}Use to display raw data from your data source
{#topic}Use to display raw data from a particular MQTT topic
{#topic.key}Use to display JSON/XML key related data  from a particular MQTT topic


You can easily use these variables in your data frames, either alone or with additional text, to display them on the LaMetric device’s screen (TIME or SKY). Here's an example of five frames created using the variables mentioned above.





Shelly Switch data visualization on LaMetric TIME 


Using different icons based on the received data


To enhance data visualization diversity, each data frame can use various icons based on variable values and set rules. For instance, the example below displays a different icon when the {apower} variable exceeds 0; otherwise, it shows the default icon.






Rule to show different icon when the {apower} variable exceeds 0;




Shelly Switch data visualization on LaMetric TIME when {apower} > 0