Skip to content

drawcustom: y coordinate stripped from payload elements in HA service call UI #97

Description

@SyFode

Bug Description

When using the opendisplay.drawcustom service through Home Assistant's Developer Tools → Actions UI (YAML mode), the y coordinate key is silently stripped from payload elements. All text and other elements that use y for vertical positioning auto-stack from the top instead of appearing at their specified y coordinates.

Steps to Reproduce

  1. Go to Developer Tools → Actions → opendisplay.drawcustom
  2. Enter YAML with a payload containing text elements with explicit y values:
service: opendisplay.drawcustom
data:
  device_id: <device_id>
  background: white
  rotate: 0
  dither: burkes
  refresh_type: full
  payload:
    - type: text
      value: "y=10"
      x: 10
      y: 10
      size: 32
    - type: text
      value: "y=250"
      x: 10
      y: 250
      size: 32
    - type: text
      value: "y=400"
      x: 10
      y: 400
      size: 32
  1. All three text lines appear stacked from the top of the display, ignoring the y values.
  2. The HA log shows: Element X: circle requires: y — confirming y is missing from the element dict when it reaches odl_renderer.

Workaround

Calling the same service via the HA REST API with JSON payload works correctly:

curl -X POST "http://HA_HOST:8123/api/services/opendisplay/drawcustom" \
  -H "Authorization: Bearer TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"device_id":["ID"],"payload":[{"type":"text","value":"y=10","x":10,"y":10,"size":32},{"type":"text","value":"y=250","x":10,"y":250,"size":32}],"background":"white","rotate":0,"dither":"burkes","refresh_type":"full"}'

Via REST API, text appears at the correct y coordinates.

Analysis

The payload field uses selector: object in services.yaml. When HA processes the YAML service call through its UI, the y key appears to be stripped from the dict items within the payload list. The x key works fine, and shape-specific coordinates (x_start, y_start, x_end, y_end) also work. Only y (a short single-letter key) is affected.

This may be related to YAML 1.1 (PyYAML) parsing where y is treated as a boolean true value, or it may be a HA selector: object schema processing issue.

Environment

  • HA version: 2026.8.1
  • Integration version: 3.0.0-beta.10
  • Device: Seeed Studio XIAO 7.5" BW (ESP32-C3)
  • Firmware: 2.26.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions