Log flooded with "became unknown" and "turned off" from ESP/MQTT

There is an ESP with poor Wifi which becomes unavailable for short time but very often. As a result, the log is flooded with “became unknown” and “turned off” and hard to see when it was “turned on” the last time. There are 6 relays so every so often I see 6 of “became unknown” immidiately followed by “turned off” which sounds more like a software things.

I tried filtering logs and it did not work:

Is there a way may be to tell mosquitto to filter those?
Any advice on how to collect “turned on” and “turned off”?

update: I also tried creating a dummy “counter” helper and run my on/off actions from a script:

alias: IRRI
fields:
  entity_id:
    description: "entity id"
  delay:
    description: "period of watering in min"
sequence:
    - service: logbook.log
      data:
        entity_id: "counter.watering_logger"
        name: "IRRI Started"
        message: "{{ entity_id }} for {{ delay }} min" 
    - service: switch.turn_on
      data:
        entity_id: "{{ entity_id }}"
    - delay:
        minutes: "{{ delay }}"
    - service: switch.turn_off
      data:
        entity_id: "{{ entity_id }}"
    - service: logbook.log
      data:
        entity_id: "counter.watering_logger" 
        name: "IRRI Finished"
        message: "{{ entity_id }} after {{ delay }} min" 
mode: single

The idea is to assign these new log entries to one entity and filter by it later. The problem with it is that log entries appear in the logbook and “name” are clickable links for “counter.watering_logger” (which is great) but filtering by this very entity produces an empty log and so does the logbook card. I am confused, is not this a bug?

The relays in question are for garden watering so it is quite essential to know if plants go yellow because of my HA skills or wrong schedule. Thanks,