MQTT State Stream include filtering problem

I am trying to thin out the state stream. Here’s what I have now:

08:46:28 MQTT.eg/sensor/termostat_8_temperature/state u"22.5"
08:46:28 MQTT.eg/sensor/termostat_8_temperature/node_id u"3"
08:46:28 MQTT.eg/sensor/termostat_8_temperature/value_instance u"1"
08:46:28 MQTT.eg/sensor/termostat_8_temperature/value_id u"“72057594093256722"”
08:46:28 MQTT.eg/sensor/termostat_8_temperature/friendly_name u"“Gulvvarme 2"”
08:46:28 MQTT.eg/sensor/termostat_8_temperature/unit_of_measurement u"“\u00b0C”"
08:46:28 MQTT.eg/sensor/termostat_8_temperature/value_index u"1"
08:46:28 MQTT.eg/sensor/termostat_8_unknown/state u"0.0"
08:46:28 MQTT.eg/sensor/termostat_8_unknown/node_id u"3"
08:46:28 MQTT.eg/sensor/termostat_8_unknown/value_instance u"1"
08:46:28 MQTT.eg/sensor/termostat_8_unknown/value_id u"“72057594093273090"”
08:46:28 MQTT.eg/sensor/termostat_8_unknown/friendly_name u"“Gulvvarme 3"”
08:46:28 MQTT.eg/sensor/termostat_8_unknown/unit_of_measurement u"“kWh”"
08:46:28 MQTT.eg/sensor/termostat_8_exporting/state u"False"
08:46:28 MQTT.eg/sensor/termostat_8_exporting/node_id u"3"
08:46:28 MQTT.eg/sensor/termostat_8_exporting/value_instance u"1"
08:46:28 MQTT.eg/sensor/termostat_8_exporting/value_id u"“72057594093273600"”
08:46:28 MQTT.eg/sensor/termostat_8_exporting/friendly_name u"“Gulvvarme 1"”
08:46:28 MQTT.eg/sensor/termostat_8_exporting/value_index u"32"

I only need the first info, so I tried to filter for that in the configuration file:

MQTT State stream

mqtt_statestream:
base_topic: eg
publish_attributes: true
include:
domains:
- lock
- binary_sensor
- switch
- sensor
entities:
- sensor.Termostat_8_temperature.state

(There should be the necessary spaces in the code, but for some reason the code view here on the forum removes leading spaces, I think.) But that give me an error message that I really don’t get much out of:

Invalid config for [mqtt_statestream]: Entity ID sensor.termostat_8_temperature.state is an invalid entity id for dictionary value @ data[‘mqtt_statestream’][‘include’][‘entities’]. Got [‘sensor.Termostat_8_temperature.state’]. (See /home/homeassistant/.homeassistant/configuration.yaml, line 77). Please check the docs at MQTT Statestream - Home Assistant

I first thought that it meant that there was a misprint in the entry, but there isn’t. It looks like it reads it as sensor.termostat while in the file it’s actually sensor.Termostat, like it says after “got”.

Edit: I also tried to replace the underscores in the 8 with .8. but that didn’t change anything.

Can somebody please tell me what’s wrong with this configuration?

See the instructions in the big blue box at the top of every page on how to format yaml in posts

The entity id is sensor.Termostat_8_temperature so just remove the .state from the end, and you should be fine.

I tried the manual formatting and messed it up badly…

But thanks! Does that mean that I can’t filter a single message like that? If that’s so I have to find another way because it leaves too much clutter.

I have never used MQTT Statestream so I don’t know its capabilities.

An entity id is a specific thing in HA consisting of <component>.<id> which is what the error message said it was looking for, so that field will not be able to specify any more detail.

OK, thanks. Then I will find an alternative solution.

Would it possible to filter the only id say state only in the future? I am facing the same problem here, currently LOADS OF mqtt msgs are published and flash my mqtt server like a hell(even exclude most of them)… I am a bit worry about those loads of msgs may someday crash the poor mqtt server eventually(a poor pi3 mqtt server), in fact I think we certainly no need a topic like icon, friendly_name etc... But a noob like me have no idea how to get only the state topic, please someone help, thanks guys

I probably have 300 entities (from 3 HA instances) updating to my mqtt server on a mac I don’t see any slow down with statestream without filtering.

I think you can filter just like history so this should just give you one entities state only.

statestream:
  publish_attributes: false
  include:
    entities:
      - sensor.Termostat_8_temperature