Skip to content

URLSearch Param issue in camera view #443

Description

@magicguitarist

Running VA 2026.7.0, Companion App 0.12.1, on an Echo Show 5 (LineageOS + VACA). I have 4 cameras.

Clicking a camera in the camera view to open it fullscreen gives a "Configuration error" card instead of the camera.

In camera.yaml, var_url_params returns a URLSearchParams object:

return new URLSearchParams(queryString);

The problem is that button-card doesn't preserve that object when it's passed around through variables. By the time var_camera reads variables.var_url_params and calls .get('camera'), it's no longer a real URLSearchParams — it's been turned into a plain object, so .get is gone.

I dumped the value to check:

  • typeof var_url_paramsobject
  • var_url_params.getundefined
  • var_url_params.constructor.nameObject (not URLSearchParams)
  • JSON.stringify(var_url_params){"camera":"camera.garage_garage_camera"}

So the data is all there, it's just that .get() doesn't exist anymore. var_camera ends up empty, falls through to the single-camera auto-select, and with more than one camera that returns nothing — so the fullscreen picture-entity gets an empty entity and throws.

Fix that worked for me — return the query string from var_url_params and build the URLSearchParams in each place that uses it:

// var_url_params
return queryString;

// var_camera, var_all_cameras
const urlParams = new URLSearchParams(variables.var_url_params);

// var_timeout_seconds
const timeout = new URLSearchParams(variables.var_url_params).get('timeout');

Same pattern is in advancedcamera.yaml, so it'd need the same change.

One more thing while I was in there: clicking "back" out of the fullscreen view sometimes threw Entity must be specified from picture-entity, because the card is always built (just hidden with CSS) even when there's no camera selected. Making that card conditional so it isn't a picture-entity when var_camera is empty fixed it:

  camera:
    card: |-
      [[[
        if (!variables.var_camera) {
          return { type: "markdown", content: " " };
        }
        return {
          type: "picture-entity",
          entity: variables.var_camera,
          camera_view: "live",
          show_name: false,
          show_state: false,
          tap_action: { action: "more-info" }
        };
      ]]]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions