Open Slalamander opened 7 months ago
Looks like a code issue. It appears that the intention was to match the docs, but the implementation isn't quite right.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
The problem
When using
data_template
and accompanyingvariables
tag in thehomeassistant.event
action, the lambda code for the variables must be explicitly declared as a lambda (using!lambda
). The provided example in the api documentation (which is forhomeassistant.service
) does not do this.In the yaml snippet,
brightness_inp
is defined in the explicit way, whereasrange_inp
is defined as shown in the documentation. In the additional information,brightness
is set to the input value integer, whereasrange
is the lambda code as defined in the ESP config.I'm not sure if this is a bug or an error in the documentation, however.
Which version of ESPHome has the issue?
2023.12.6
What type of installation are you using?
pip
Which version of Home Assistant has the issue?
2024.1.2
What platform are you using?
ESP32
Board
az-delivery-devkit-v4
Component causing the issue
api
Example YAML snippet
Anything in the logs that might be useful for us?
No response
Additional information
The event data is returned in home assistant as: