You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inside of mqtt.homeassistant, implement our own internal TransformationService and TransformationServiceProvider. It will be based on the JinjaTransformationService, but will have a unique instance per component, so that the other variables can also be populated and made available to the template, and the Home Assistant extensions can be registered. And value will be populated (and value_json will only be populated if it's valid JSON) so that it will work for command templates.
For more complex components like template schema lights, I'll subclass the internal TransformationService to provide the additional variables.
The text was updated successfully, but these errors were encountered:
ccutrer
added
the
bug
An unexpected problem or unintended behavior of an add-on
label
Sep 5, 2024
Right now the Home Assistant binding relies on the Jinja transformation being installed (it does not install automatically! See #6875), and can only pass
value_json
, not any of the additional variables documented at https://www.home-assistant.io/docs/configuration/templating/#using-templates-with-the-mqtt-integration, nor the Home Assistant specific extensions documented at https://www.home-assistant.io/docs/configuration/templating/#home-assistant-template-extensions (see #15382). Since #17356 (and #17358), we've gotten past the problem of having direct access to Jinjava in order to provide a richer "transformation" experience than thevalue_json
of the basic Jinja transformation service, and can thus get on to addressing these issues.The gameplan to accomplish this:
Inside of mqtt.homeassistant, implement our own internal
TransformationService
andTransformationServiceProvider
. It will be based on theJinjaTransformationService
, but will have a unique instance per component, so that the other variables can also be populated and made available to the template, and the Home Assistant extensions can be registered. Andvalue
will be populated (andvalue_json
will only be populated if it's valid JSON) so that it will work for command templates.For more complex components like template schema lights, I'll subclass the internal
TransformationService
to provide the additional variables.The text was updated successfully, but these errors were encountered: