Open majkers opened 2 years ago
Maybe this is related?
invalid key: "OrderedDict([('449,70 zł', None)])" in "/config/configuration.yaml", line 807, column 0
Perhaps a text encoding issue? What happens if you change '449,70 zł'
to '449,70
?
No, still the same
Have the same issue with attributes
Have the same issue with attributes
If you post more details about your problem, we may have a better chance of determining the cause.
Have this config
var:
lexman_1_data:
friendly_name: "Lexman 1 data"
initial_value: '{"current_light": ""}'
attributes:
scene_1: '{{ {"counter": 1} }}'
scene_2: '{{ {"counter": 2} }}'
scene_3: '{{ {"counter": 3} }}'
scene_4: '{{ {"counter": 4} }}'
Wanted to store simple json
Okay, I think I know what is happening here. Variable attributes are templates, and they are only updated when a tracked event fires. Neither of your variables specify any tracked events, so the attributes are never evaluated.
You can fix this by specifying the following tracked event which will update your variable attributes when home assistant starts.
tracked_event_type: homeassistant_start
Alternatively, you can set the attributes using the var.set
service.
As an aside, this behavior can be inferred from the documentation, but it is not obvious. A proper fix for this is to create a separate attribute_templates
property for templates and leave attributes
for values only.
OK but how about reloading this integration? By watching this event, reloading rom YAML section won't work right? This is essential for my and the reason why I wanted to switch to your integration from similar...
OK but how can I pass component attribute?
I am not sure what you are asking.
This event (COMPONENT_LOADED) requires additional data to be passed -> component (Domain of the integration that has just been initialized. Example: light.) How can I pass it from your integration?
The domain of the Variable component is var
.
Yes I know that but how can I pass this param via var integration?
tracked_event_type: COMPONENT_LOADED
and then what?
Ah, I see. That is not supported at the moment.
There might be another way to solve your problem, but I'm not sure I understand your use case.
Hi,
here is my config:
And this is what I see in HA:
So attributes get null as value...