Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 106800

Template: Checking empty json object/array

$
0
0

Hi there,
I would like to parse my JSON data coming in via MQTT. I want to do this with a value_template.
But sometimes the JSON object contains something, but sometimes it is empty. How can I check if a JSON Object and/or a JSON Array is not empty?
Currently, unfortunately, I still get the following error, so I would like to fix that with this:
Error parsing value: dict object has no element 0

I hope you can help me and understand my ugly english :smile:

Thanks,
Dominic

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 106800

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>