I have a MQTT sensor on my energy converter to my solarcells on the roof of the house that publish the data below regarding temperature of the solar string optimisers (SSO)
when I listen to the topic “extapi/data/sso” in HA I get these results below.
I have 3 SSO units that is publishing the same data on the MQTT topic with different ID:s
{
"relaystatus": {
"val": "0"
},
"temp": {
"val": "39.770"
},
"wpv": {
"val": "7770674028014"
},
"ts": {
"val": "2020-06-20T13:20:34UTC"
},
"udc": {
"val": "767.102"
},
"faultcode": {
"val": "0"
},
"ipv": {
"val": "1.534"
},
"upv": {
"val": "439.185"
},
"id": {
"val": "19110206"
}
}
{
"relaystatus": {
"val": "0"
},
"temp": {
"val": "37.249"
},
"wpv": {
"val": "5393140186776"
},
"ts": {
"val": "2020-06-20T13:20:34UTC"
},
"udc": {
"val": "766.891"
},
"faultcode": {
"val": "0"
},
"ipv": {
"val": "1.252"
},
"upv": {
"val": "375.293"
},
"id": {
"val": "19110137"
}
}
{
"relaystatus": {
"val": "0"
},
"temp": {
"val": "39.119"
},
"wpv": {
"val": "9179570957817"
},
"ts": {
"val": "2020-06-20T13:20:34UTC"
},
"udc": {
"val": "765.222"
},
"faultcode": {
"val": "0"
},
"ipv": {
"val": "1.471"
},
"upv": {
"val": "501.961"
},
"id": {
"val": "19110205"
}
}
I am trying to get the individual temp values into different sensors but it don’t work
The configuration.yaml code that I am fighting with looks like this.
- platform: mqtt
state_topic: 'extapi/data/sso'
name: 'SSO 19110205'
unique_id: '19110205'
unit_of_measurement: '°C'
value_template: >
{% if value_json.id.val == 19110205 %}
{{ (value_json.temp.val) | round(1) }}
{% endif %}
- platform: mqtt
state_topic: 'extapi/data/sso'
name: 'SSO 19110206'
unique_id: '19110206'
unit_of_measurement: '°C'
value_template: >
{% if value_json.id.val == 19110206 %}
{{ (value_json.temp.val) | round(1) }}
{% endif %}
- platform: mqtt
state_topic: 'extapi/data/sso'
name: 'SSO 19110137'
unique_id: '19110137'
unit_of_measurement: '°C'
value_template: >
{% if value_json.id.val == 19110137 %}
{{ (value_json.temp.val) | round(1) }}
{% endif %}
Any suggestions of how to filter out this ?