Allow an ability to call a service without any logging/recording

I am currently working on a blueprint for a color loop script

This script runs a continuous loop which updates the color of a light (configurable down to as often as once a second). I also am planning for it to work for color lights with no color transition capabilities which could end up changing the color up to 5-10x a second.

This obviously has issues with flooding the network, but even if the limit is cut off at one color change per second this ends up flooding the DB.

This is especially frustrating as a user will never see these entries in their logbook nor history as the on/off state doesn’t change, just the color.

I would like to request a means to be able to call a service and configure the call to not perform any logging (and possibly no event triggers).

I would assume it may look something like:

service: light.turn_on
  entity_id: light.my_light
  rgb_color: [11, 22, 33]
# Prevent any DB logging
record: false
# Prevent events from firing
propogate_events: false

I understand this is a tall order, if there is any other existing way to accomplish this by other means I would be interested, including:

  • Temporarily disable logging for an entity while a script is running (and re-enable when the script it finished).
  • Disable logging for an entity if a specific instance is changing it.

This also has issues with ever increasing memory consumption.

Not a good idea.

Make it state driven.

1 Like

Fair enough, I was only focused on issues with DB logging and not memory. I’m still learning how all of this works.

Correct me if I’m wrong, changing to a time-based automation would then be a state driven approach?

Triggering an automation as often as once a second (or faster) is more performant than a looping script?

Regardless of how it handles the looping, the end goal is to change colors often, is there any way to temporarily disable the db logging (besides completely excluding the entity via recorder config)?

No, that would be polled. State driven would be something like,

If colour is red for 1 sec, set colour green.
If colour is green for 1 sec, set colour blue.
If colour is blue for 1 sec, set colour red.

It still loops but each trigger and action finishes.

There is no way to temporarily exclude an item from the log that I know of.

I have a similar requirement.
I have a “REPEAT/WHILE” loop to toggle lights on and off for one minute, triggered by a motion sensor. This generates 30 log events every time it triggers - I would like to decease the log volume!!

any update of this problem?

I had some MQTT that rounded the power used values of some plug socket sensors (created in an attempt to reduce IO and database writes)

Whilst the number of recorded state changes were massively reduced, unfortunately the calls to mqtt publish all got stored in the database.

I ended up disabling the recording of the call_service event in the recorder configuration, however I would have more appreciated the ability to just prevent recording the specific service: mqtt.publish call rather than all of them