Recorder - How to include ONLY some entities?

Hi!
It’s possible to include ONLY some sensors in recorder configurations?
I have a lot of entities, including sensors, that I don’t want to record…some of theses sends a lot of data per minute and I don’t want to add everyone to exclude list in my recorder config…so my question is, is there any way to exclude everything and include just some specific itens to recorder?
I have tried this configuration, but it doesn’t work (as expected, acording to documentation):

purge_keep_days: 7
commit_interval: 60
include:
  entities:
    - sensor.temperatura_externa
    - sensor.umidade
    - sensor.velocidade_do_vento_media
    - sensor.velocidade_do_vento_maxima
    - sensor.temperatura_painel_solar
    - input_select.maquina_de_lavar
    - sensor.caixa_dagua_percentual
    - sensor.temperature_caixa
    - sensor.energy_real_consumed_fronius_meter_0_http_192_168_22_46
    - sensor.energy_real_produced_fronius_meter_0_http_192_168_22_46
    - sensor.energy_total_fronius_inverter_1_http_192_168_22_46
    - sensor.quarto_jonis_e_pri_temperatura_humidity
    - sensor.quarto_jonis_e_pri_temperatura_temperature
    - sensor.area_de_limpeza_maquina_de_lavar_energy
    - sensor.sala_de_jantar_adega_energy
  entity_globs:
    - sensor.sala_temperatura_*
    - sensor.sala_de_jantar_temperatura_*    
    - sensor.escritorio_temperatura_*
    - sensor.garagem_temperatura_viveiro_*
    - sensor.plantas_*
    - sensor.temperatura_boiler*
    - sensor.area_de_limpeza_maquina_de_lavar_*

exclude:
  domains:
    - automation
    - binary_sensor
    - calendar
    - camera
    - climate
    - device_tracker
    - group
    - input_text
    - input_number
    - light
    - lock
    - media_player
    - remote
    - script
    - sensor
    - sun
    - switch
    - zone
    - weather

The problem is that when I exclude a domain, they are not including in ‘include’ key, as ‘exclude’ has preference in logic.

Not that this configuration doesn’t produce any error, syntax is right…just the devices isn’t recorded.

1 Like

Have you tried removing or thinning the excludes? For me, I decided I didn’t want every possible data point and my config only has includes and that’s all I get, nothing more. In fact, I have even modified my entity naming system so I can auto include certain entities via the globs based on my naming system (i.e., I include any glob of sensor.*_kwh, so if I want to track power I just make sure the entity has that suffix).

:rofl: :rofl: :rofl: :rofl:

No words here… :crazy_face:

Sometimes we need a view from ‘outside’, right? You are totally right. I didn’t tested yet (i’m at work right now), but looking better into documentation, that’s exactly what you said:

By default, no entity will be excluded. To limit which entities are being exposed to recorder, you can use the include and exclude parameters.

Ok, this doesn’t help me…BUT, in the sequence of this text, we have this one:

Filters are applied as follows:

1) No includes or excludes - pass all entities
2) Includes, no excludes - only include specified entities
3) Excludes, no includes - only exclude specified entities
(...)

So, if I remove exclude and keep only include like you sugested, everything should work as I expect.

Thank you very much!

1 Like