Ever changing RTSP login

Hi all

I have managed to get my Aqara G3 camera integrated into home assistant using niceboygithub/AqaraCamera.

Because I use Frigate and like webrtc-camera, I need an RTSP url.
rtsp:// :@192.168.1.blablah

The problem is that the username and password for the stream change randomly.

The entity for the camera does have the valid rtsp url as shown below

type: entity
entity: camera.camera_hub_g3_4601_2
attribute: rtsp_url

My ask is…
How can I use this attribute in my

  • configuration.yaml - for ffmpeg
  • custom:web-rtc card - for the url:
  • frigate.yaml - for frigate integration

Is there a way of extracting this valid rtsp using like a template sensor? and inserting this into my yamls? I fear the configuration.yaml & frigate.yamls are called too early.

Thanks
Brent

You can have an automation that triggers when that attribute changes:

Fires when the state of any of given entities changes. If only entity_id is given, the trigger will fire for all state changes, even if only state attributes change.

You can then extract save the value in an input_text helper.

You could also make a template sensor using the same trigger, saving you the helper.

If you want more control over when an entity updates, you can define a trigger. Triggers follow the same format and work exactly the same as triggers in automations. This feature is a great way to create entities based on webhook data (example), or update entities based on a schedule.

Either the helper or sensor you can then use elsewhere.

maybe it can help you