Toggle entity options (Enable Preload stream option for camera entity)

Hi guys,

I am trying to figure out how to toggle an entites option/attribute via automation (not sure what the correct wording is).

Specifically, i want to enable the “preload stream” option on my camera entitiy when not at home.

I can see the toggle in the UI’s entitiy options, but I have no clue how to change the value via an automation/script. I can’t find any suitable service, i tried input boolean but can’t find a target.

Many thanks in advance!

2 Likes

I want to do something similar, where I turn on the “Preload camera stream” option for 2 cameras in the evening that I use to monitor my little ones when in bed. In the morning I can then turn that off. I don’t see the need to keep the streams alive all day long.

If you ever figure this out please post your solution (I will too if I figure out something).

I’m also interested in this, so please do post a solution if you find it.

My problem is that the “lookback” option stops to work after awhile, and my only solution (I think) has been to toggle the preload_stream off and on in order to make it work again. Using Eufy cameras with the Eufy Security Add-on.

Hi there; in my use case, i only power on my camera when away from home, and i want to use the lookback option (i.e. record 10 seconds before the actual recording startup timestamp).

I noticed that even if i ticked the preload_stream option, the stream must have been accessed once for the lookback to work.

To work around it, i created a script which

  • powers on the camera (smart outlet)
  • waits for it to power up (a fixed time)
  • calls homeassistant.reload_config_entry service on the camera device (this is an Axis camera and it won’t work if i don’t reload the integration after power on)
  • calls the camera.play_stream service onto one of my chromecast audio devices (even if they do not display the stream, it seems to initiate the stream)
  • waits a few seconds
  • stops playback on the chromecast audio device

From this point on, the lookback feature works.

I think that HA probably only starts the preload stream when it’s start up, and not when the camera comes back / powers up.

Anyone knows whether this is the problem ?

1 Like

I have the same question as @Morpheus90x. I only want the camera stream preloaded during bedtime, not running 24/7. It’s a boolean toggle that only seems to appear on the camera.baby_monitor_sub config popup. Which service would I call to update this “Preload camera stream” toggle?

In case it helps, here’s the entity’s state attributes:

{
  'entity_picture': '/api/camera_proxy/camera.baby_monitor_sub?token=abc123', 
  'friendly_name': 'Baby Monitor Live Feed', 
  'supported_features': <CameraEntityFeature.STREAM: 2>
}

Drilling deeper to {{ states.camera.baby_monitor_sub.attributes.supported_features }} simply returns the number 2. I’m guessing we’d need to update that CameraEntityFeature object, just can’t figure out how to do that via automation.

This worked for me using an Chromecast Audio device and Reolink cameras.

Although what @Henke said was also true:

My problem is that the “lookback” option stops to work after awhile, and my only solution (I think) has been to toggle the preload_stream off and on in order to make it work again.