Many Template variable warnings

Hello, i can see in logs the following warnings. Is there any solution to this? Thanks

Source: helpers/template.py:2345
First occurred: February 11, 2024 at 5:00:23 PM (1069 occurrences)
Last logged: 9:14:24 AM

Template variable warning: 'dict object' has no attribute 'disc' when rendering '{{ value_json.disc }}'
Template variable warning: 'dict object' has no attribute 'ohdisc' when rendering '{{ value_json.ohdisc }}'
Template variable warning: 'dict object' has no attribute 'enablecrc' when rendering '{{ value_json.enablecrc }}'
Template variable warning: 'dict object' has no attribute 'invertiq' when rendering '{{ value_json.invertiq }}'
Template variable warning: 'dict object' has no attribute 'onlyknown' when rendering '{{ value_json.onlyknown }}'

These are Home Assistant logs ?

Could you share the version of OMG and HA version please?

Yes HA logs.
HA 2024.2 version and v1.6.0 OMG (i couldn’t make v1.7.0 work at my TTGO LoRa32 868Mhz ESP32 LoRa chip V2.1-1.6 which i successfully made it work with 1.6.0 OMG as i said there → V2.1-1.6 )

I’m seeing the same warnings in my Home Assistant log with v1.7.0 installed.
They occur around 10 times a day.

2024-05-30 09:57:34.148 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'enablecrc' when rendering '{{ value_json.enablecrc }}'
2024-05-30 09:57:34.150 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'invertiq' when rendering '{{ value_json.invertiq }}'
2024-05-30 09:57:34.151 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'onlyknown' when rendering '{{ value_json.onlyknown }}'

Using MQTT Explorer in HA, I see 99% of the packets look fine:

{"frequency":915000000,"txpower":14,"spreadingfactor":7,"signalbandwidth":125000,"codingrate":5,"preamblelength":8,"syncword":"0x12","enablecrc":true,"invertiq":false,"onlyknown":false}

Apparently, an occasional packet is missing values for “invertiq”, “enablecrc”, and “onlyknown”

I was able to capture one of the spurious JSON packets that generates a warning in Home Assistant. It contains non-printable characters shown as hex data.

{
  "hex": "E67EB3CC5119BADFB85819F2678FF1608E7D0BF86A83130C84CDC9E4DAAA4F4B13D7DC5240866D21548500DBB2CBEE4ED5A3A447182B9CD75F2A841BB6455670260C567EC0E7C910C9D9284DB2366D8694320FCDD73BA4C581EEFCA962941CFEB3CE695F8110F70F207F4377923022146FC3C6ACFD0C603CF54DA1781616FC5DA5E6A3E32D622EB2354A313490A64BEC597E0D70DAA3F40B7587AF65B874C5FA70BAC1A349D588BA07B5C02B9184481EDF1615A6",
  "rssi": -113,
  "snr": -12.25,
  "pferror": -7038,
  "packetSize": 180
}

I think this packet is just random noise or junk received from a distant Lora module.
To prevent these packets from generating warnings in Home Assistant, simply enable “Only Known” in the Web UI or Home Assistant Lora device controls.