snarky-snark / home-assistant-variables

A custom Home Assistant component for declaring and setting generic variable entities dynamically.
Apache License 2.0
274 stars 16 forks source link

Service to var.set a mapping attribute #108

Open GaPhi opened 5 months ago

GaPhi commented 5 months ago

The current service only allows string as an attribute value.

I need to set a mapping, which seems possible using the developers tools must is rejected by the service call. template value should be a string for dictionary value @ data['attributes']['my_attribute']

Is is possible to update the service call to allow any attribute value type ? It would be easier to use (today I transform the data in a JSON string to store it, and need to parse it when reading it again)

Thanks !

snarky-snark commented 5 months ago

Attribute values are template strings which can evaluate to non-string values.

snarky-snark commented 5 months ago

https://www.home-assistant.io/docs/configuration/templating/