Splitting history and recorder yaml files

Hi.

I have a problem with splitting history and recorder to standalone yaml files.
In configuration. yaml added lines:
recorder: !include recorder.yaml
history: !include history.yaml

and history.yaml looks like:

include:
  entity_globs:
    - sensor.system_monitor*
  entities:
    - sensor.dom_pm2_5
    - sensor.dom_wspolny_indeks_jakosci_powietrza
    - sensor.tv_yt
    - sensor.tv_on_yt
    - sensor.adguard_home_zablokowane_zapytania_dns
    - sensor.adguard_home_wspolczynnik_zablokowanych_zapytan_dns
    - sensor.adguard_home_zapytania_dns
    - binary_sensor.zamek_drzwi_frontowych_contact
    - media_player.50pus8807_12_3
#      - sensor.czujnik_sypialnia_temp_filtr
#      - sensor.czujnik_lazienka_temp_filtr
#      - sensor.czujnik_salon_temp_filtr
#      - sensor.roznica
#      - inpute_number.zero
#      - sensor.mai
#      - sensor.state
#      - sensor.file
#      - humidifier.mietek
#      - climate.bt_salon
    - climate.bt_hive_salon
    - climate.bt_sypialnia
    - climate.bt_lazienka
    - climate.popp
    - climate.termostat_sypialnia_zigbee
    - climate.termostat_salon
    - climate.termostat_lazienka
#      - climate.hive_salon
    - sensor.hive_salon_pi_heating_demand
    - sensor.popp_pi_heating_demand
#      - climate.hive_lazienka
#      - sensor.hive_lazienka_pi_heating_demand
#      - sensor.termostat_salon_position
    - sensor.gniazdko_lazienka_power
    - switch.gniazdko_salon
    - sensor.tuya_temp_temperature
    - sensor.czujnik_salon_temperature
    - sensor.czujnik_sypialnia_temperature
    - sensor.czujnik_lazienka_temperature
    - sensor.czujnik_lazienka_humidity
    - switch.przekaznik_helios_l2
    - sensor.adguard_home_average_processing_speed
    - sensor.load_1m
    - sensor.disk_use
    - sensor.disk_use_percent
    - sensor.memory_use
    - sensor.memory_free
    - sensor.memory_use_percent
#      - sensor.processor_use_percent
    - sensor.processor_use
    - sensor.cpu_temperature
    - sensor.system_monitor_processor_temperature
    - sensor.system_monitor_disk_free
    - input_number.srednia_wilgotnosc
#      - binary_sensor.czujnik_dymu_smoke
exclude:
  domains:
    - sensor
    - binary_sensor
    - climate
    - media_player
    - automation
    - script
    - alert
    - calendar
    - camera
    - group
    - input_boolean
    - input_button
    - light
    - lock
    - number
    - person
    - select
    - switch
    - update
    - vaccum
    - weather
    - zone
    - device_tracker
    - uptime
    - time_date
    - worldclock
  entity_globs:
    - humidifier.*
    - sensor.*
    - binary_sensor.*
    - climate.*
    - media_player.*
  entities:
    - binary_sensor.okno_salon_contact
    - binary_sensor.okno_sypialnia_contact
    - binary_sensor.ruch_salon_occupancy
    - binary_sensor.ruch_sypialnia_occupancy
    - sun.sun
#      - sensor.home_assistant_v2_db_size
    - weather.openweathermap

But I see entity histories that are excluded from the history.
Same with recorder.yaml.

Please help me

Can’t find the post anymore, but it said to not use include and exclude at the same time, because it does not do what you expect it to do.

but it work yesterday for example.

and. i create custom sensor that cound not be include to history by deflaut like sensor.dystans_ania but i can see history:

image