It is sensible info, I can’t past the entire JSON, way to long to review it,
I paste the following section, that I can review and XXX mark the sensible info
IDS change, so are not usable, but IdData Attribute is unique (I think so far) and Instance is not unique to a single device, it repeats across multiple devices,
Maybe match a IdDataAttribute, or
another option could be to match both, an Instance and the description of that instance, this would be the most precise method, to look for the formatted value of an instance and a description.
An instance (eg:temp sensor) has multiple descriptions (senso type, sensor offset, sensor value)
What I want to extract for example is the fridge temp (AS A FLOAT VALUE!!!) which is in the ID 178,
Prevously extracted via this which gives errors when the JSON suddenly includes new IDs or publishes them in different order:
sensor:
- platform: template
sensors:
triaca_fridge_temp:
friendly_name: "Temp. Nevera"
icon_template: mdi:thermometer
unit_of_measurement: "ºC"
value_template: '{{ states.sensor.vrm_data.attributes.records[177]["formattedValue"][:-2] | float () }}'
[
{
"idSite": xxxxxxx,
"timestamp": 1637003894,
"Device": "Gateway",
"instance": 0,
"idDataAttribute": 641,
"description": "Bad non-unique identifier",
"formatWithUnit": "%s",
"dbusServiceType": null,
"dbusPath": null,
"code": "o",
"bitmask": 0,
"formattedValue": "02xxxxxa",
"id": 1
},
{
"idSite": xxxxxx,
"timestamp": 1634301837,
"Device": "Gateway",
"instance": 0,
"idDataAttribute": 1,
"description": "gatewayID",
"formatWithUnit": "%s",
"dbusServiceType": null,
"dbusPath": null,
"code": "d",
"bitmask": 0,
"formattedValue": "OS",
"dataAttributeEnumValues": [
{
"nameEnum": "VGR, VGR2 or VER",
"valueEnum": 0
},
{
"nameEnum": "OS",
"valueEnum": 1
},
{
"nameEnum": "OS",
"valueEnum": 2
},
{
"nameEnum": "LoRaWAN lopy",
"valueEnum": 3
},
{
"nameEnum": "PHYSEE NodeMCU",
"valueEnum": 4
}
],
"id": 2
},
{
"idSite": xxxxx,
"timestamp": 1634301837,
"Device": "Gateway",
"instance": 0,
"idDataAttribute": 386,
"description": "Productid",
"formatWithUnit": "%s",
"dbusServiceType": null,
"dbusPath": null,
"code": "mi",
"bitmask": 0,
"formattedValue": "xxxxx",
"id": 3
},
{
"idSite": xxxx,
"timestamp": 1634301837,
"Device": "Gateway",
"instance": 0,
"idDataAttribute": 387,
"description": "MachineName",
"formatWithUnit": "%s",
"dbusServiceType": null,
"dbusPath": null,
"code": "mn",
"bitmask": 0,
"formattedValue": "xx xxxx",
"id": 4
},
{
"idSite": xxxxx,
"timestamp": 1634301837,
"Device": "Gateway",
"instance": 0,
"idDataAttribute": 2,
"description": "Fw Version",
"formatWithUnit": "%s",
"dbusServiceType": null,
"dbusPath": null,
"code": "v",
"bitmask": 0,
"formattedValue": "v2.73",
"id": 5
},
{
"idSite": xxxxxx,
"timestamp": 1634301837,
"Device": "Gateway",
"instance": 0,
"idDataAttribute": 3,
"description": "Fw Build date",
"formatWithUnit": "%s",
"dbusServiceType": null,
"dbusPath": null,
"code": "build",
"bitmask": 0,
"formattedValue": "20210830181758",
"id": 6
},
{
"idSite": xxxxxx,
"timestamp": 1634301837,
"Device": "Gateway",
"instance": 0,
"idDataAttribute": 556,
"description": "Machine serial number",
"formatWithUnit": "%s",
"dbusServiceType": null,
"dbusPath": null,
"code": "ms",
"bitmask": 0,
"formattedValue": "xxxxxx",
"id": 7
},
{
"idSite": xxxxx,
"timestamp": 1634301837,
"Device": "Gateway",
"instance": 0,
"idDataAttribute": 453,
"description": "Capabilities",
"formatWithUnit": "%s",
"dbusServiceType": null,
"dbusPath": null,
"code": "cp",
"bitmask": 1,
"formattedValue": "xxxxxxxx",
"dataAttributeEnumValues": [
{
"nameEnum": "MxxxxxPC",
"valueEnum": 1
},
{
"nameEnum": "xxxxxxmand",
"valueEnum": 2
},
{
"nameEnum": "Vxxxxion",
"valueEnum": 4
},
{
"nameEnum": "Vxxxxxnk",
"valueEnum": 8
}
],
"id": 8
},
{
"idSite": xxxxx,
"timestamp": 1634301837,
"Device": "Gateway",
"instance": 0,
"idDataAttribute": 237,
"description": "Boot type",
"formatWithUnit": "%s",
"dbusServiceType": null,
"dbusPath": null,
"code": "w",
"bitmask": 0,
"formattedValue": "xxxxxx.",
"dataAttributeEnumValues": [
{
"nameEnum": "Tmpxxxxx",
"valueEnum": "-3"
},
{
"nameEnum": "Rexxxxiled",
"valueEnum": "-2"
},
{
"nameEnum": "Reaxxxxxiled",
"valueEnum": "-1"
},
{
"nameEnum": "Old kexxxxort, etc.",
"valueEnum": 0
},
{
"nameEnum": "Cxxxxxxot",
"valueEnum": 1
},
{
"nameEnum": "UnrxxxxxxGX",
"valueEnum": 2
},
{
"nameEnum": "Reset button",
"valueEnum": 3
},
{
"nameEnum": "Cold boot",
"valueEnum": 4
},
{
"nameEnum": "Reboot command",
"valueEnum": 5
},
{
"nameEnum": "Watchdog reboot",
"valueEnum": 17
},
{
"nameEnum": "Maxxxxxxx2.06)",
"valueEnum": 29997
},
{
"nameEnum": "Watchdog-ENOMEM",
"valueEnum": 30012
},
{
"nameEnum": "Watchdog-EMAXLOAD (load average too high)",
"valueEnum": 30253
}
],
"id": 9
},
{
"idSite": xxxxxx,
"timestamp": 1636292722,
"Device": "Gateway",
"instance": 0,
"idDataAttribute": 154,
"description": "Remote support",
"formatWithUnit": "%s",
"dbusServiceType": "settings",
"dbusPath": "/Settings/System/RemoteSupport",
"code": "rss",
"bitmask": 0,
"formattedValue": "xxxxx",
"dataAttributeEnumValues": [
{
"nameEnum": "xxxxx",
"valueEnum": 0
},
{
"nameEnum": "xxxxxx",
"valueEnum": 1
}
],
"id": 10
},
{
"idSite": xxxxxxx,
"timestamp": 1636948947,
"Device": "Gateway",
"instance": 0,
"idDataAttribute": 543,
"description": "Remote support IP and port",
"formatWithUnit": "%s",
"dbusServiceType": "settings",
"dbusPath": "/Settings/System/RemoteSupportIpAndPort",
"code": "rsIpPort",
"bitmask": 0,
"formattedValue": "xx.x.xx.xx;xxxxxx",
"id": 11
},
{
"idSite": xxxxxx,
"timestamp": 1636292722,
"Device": "Temperature sensor",
"instance": 26,
"idDataAttribute": 637,
"description": "Temperature custom name",
"formatWithUnit": "%s",
"dbusServiceType": null,
"dbusPath": null,
"code": "tscn",
"bitmask": 0,
"formattedValue": "Nevera Arcon",
"id": 173
},
{
"idSite": xxxxxxx,
"timestamp": 1636292722,
"Device": "Temperature sensor",
"instance": 26,
"idDataAttribute": 445,
"description": "Product ID",
"formatWithUnit": "%s",
"dbusServiceType": null,
"dbusPath": null,
"code": "tsP",
"bitmask": 0,
"formattedValue": "xxxxx",
"id": 174
},
{
"idSite": xxxxxxx,
"timestamp": 1636292722,
"Device": "Temperature sensor",
"instance": 26,
"idDataAttribute": 447,
"description": "Temperature scale factor",
"formatWithUnit": "%.1F",
"dbusServiceType": null,
"dbusPath": null,
"code": "tsc",
"bitmask": 0,
"formattedValue": "1.0",
"id": 175
},
{
"idSite": xxxxxx,
"timestamp": 1636292722,
"Device": "Temperature sensor",
"instance": 26,
"idDataAttribute": 448,
"description": "Temperature offset",
"formatWithUnit": "%.0F",
"dbusServiceType": null,
"dbusPath": null,
"code": "tso",
"bitmask": 0,
"formattedValue": "8",
"id": 176
},
{
"idSite": xxxxxx,
"timestamp": 1636292722,
"Device": "Temperature sensor",
"instance": 26,
"idDataAttribute": 449,
"description": "Temperature type",
"formatWithUnit": "%s",
"dbusServiceType": null,
"dbusPath": null,
"code": "tst",
"bitmask": 0,
"formattedValue": "Fridge",
"dataAttributeEnumValues": [
{
"nameEnum": "Battery",
"valueEnum": 0
},
{
"nameEnum": "Fridge",
"valueEnum": 1
},
{
"nameEnum": "Generic",
"valueEnum": 2
}
],
"id": 177
},
{
"idSite": xxxxxxx,
"timestamp": 1637004314,
"Device": "Temperature sensor",
"instance": 26,
"idDataAttribute": 450,
"description": "Temperature",
"formatWithUnit": "%.1F °C",
"dbusServiceType": null,
"dbusPath": null,
"code": "tsT",
"bitmask": 0,
"formattedValue": "12.0 °C",
"id": 178
},
{
"idSite": xxxxxxx,
"timestamp": 1637004314,
"Device": "Temperature sensor",
"instance": 26,
"idDataAttribute": 451,
"description": "Temperature status",
"formatWithUnit": "%s",
"dbusServiceType": null,
"dbusPath": null,
"code": "tsS",
"bitmask": 0,
"formattedValue": "OK",
"dataAttributeEnumValues": [
{
"nameEnum": "OK",
"valueEnum": 0
},
{
"nameEnum": "Disconnected",
"valueEnum": 1
},
{
"nameEnum": "Short circuited",
"valueEnum": 2
},
{
"nameEnum": "Reverse Polarity",
"valueEnum": 3
},
{
"nameEnum": "Unknown",
"valueEnum": 4
}
],
"id": 179
}
]