In 3 templates of one action I need to use a rather large dictionary.
Basically, I’m trying to fill in event_data like this:
- event: test
event_template_data:
value1: >-
{% set dict = {...} %}
{{ ... }}
value2: >-
{% set dict = {...} %}
{{ ... }}
value3: >-
{% set dict = {...} %}
{{ ... }}
I tried to use template sensor, but there is state’s length limit of 255 symbols, my dict is bigger than that.
Any other idea how to avoid pasting the same dict in each template?
My dict looks like:
{
'sensor/pir/ground_floor/hall': {'codes': {13937454: {'state': 'detected', 'command': 'ON'}}},
'wall_switch/1st_floor/bathroom/extractor_fan': {
'codes': {
12001361: {'state': 'on', 'command': 'ON'},
12001360: {'state': 'off', 'command': 'OFF'}
}
},
'sensor/contact/1st_floor/safe': {
'codes': {
8895854: {'state': 'open', 'command': 'Open', 'retain': true},
8895847: {'state': 'closed', 'command': 'Closed', 'retain': true},
8895851: {'state': 'tampered', 'command': 'Tampered'}
},
'attributes': {
8895855: {'name': 'low_battery', 'command': 'ON'}
}
}
}