Home_Assistant_Integration icon indicating copy to clipboard operation
Home_Assistant_Integration copied to clipboard

Unable to have a calculated value for parameter x_end

Open metscore opened this issue 6 months ago • 0 comments

Describe the bug I'm trying to draw a rectangle with a calculated value derived from a state. When I paste the yaml into the automation of HomeAssistant and reload the same yaml directly, the calculated value is x_end: "[object Object]": null which makes the automation fail.

To Reproduce Steps to reproduce the behavior:

  1. In Home Assistant, go the Automations tab and Create an automation.
  2. Press Edit in yaml mode
  3. Paste the this partial code as one part of a payload:
- type: rectangle
  x_start: 82
  y_start: 24
  x_end: {{ (states('sensor.pollen_malmo_bjork') | int * 10 + 80 - 2) }}
  y_end: 38
  width: 0
  fill: red
  outline: red

  1. Save the automation and re-open in yaml mode again.
  2. The "calculated" value (x_end) is now replaced with x_end: "[object Object]": null

image

  1. If the "erroneous" calculation is replaced by a regular numerical value, the display output works just fine.

image

If I try to use the following code, i.e. no state object, just values x_end: {{ 123 | int * 10 + 80 - 2 }}

this also results in a x_end: "[object Object]": null

Expected behavior For instance I expected the following x_end: {{ 123 | int * 10 + 80 - 2 }} to result in 1308 since it works perfectly in HA developer tools template.

image

Additional context I use HA core 2024.7.4 HA OS 12.4 OpenEPaperLink 0.4.9.1

metscore avatar Aug 15 '24 09:08 metscore