Templating for data with a dot

I am scratching my head on the following: I have a SDS011 sensor on a Tasmota Wemos D1. This spits out the following throught MQTT:


I can extract the PM10 value through:
value_template: “{{ value_json[‘SDS0X1’].PM10 }}”

But the problem is that the PM2.5 value looks impossible to extract as value due to the dot.

Any thoughts on how I can get the PM2.5 value through a template?

Does this work?

value_template: "{{ value_json['SDS0X1']['PM2.5'] }}"
1 Like

That only results in ‘status unknown’…

How about:

value_template: "{{ value_json['SDS0X1'].['PM2.5'] }}"
1 Like

Apologies! Due to an error from my end (wrong topic) the previous suggestion didn’t work. After correcting it the right syntax is as you indicated: value_template: “{{ value_json[‘SDS0X1’][‘PM2.5’] }}”

Thanks for your help!


Glad to hear it. That square bracket syntax always confuses me so I wasn’t quite sure.

Hello Frank , can you add full SDS011 sensor yaml configuration? Thanks.