Automation template data problem since upgrade

I recently updated HA to version 106.2 (coming from 102.0).
Since this update one of the data_templates in my automations stopped working:

- id: blinds_set_tilt
  alias: Blind tilting
  mode: parallel
  max: 4
  trigger:
  - platform: state
    entity_id: input_number.blind_1_tilt
  - platform: state
    entity_id: input_number.blind_2_tilt
  - platform: state
    entity_id: input_number.blind_3_tilt
  - platform: state
    entity_id: input_number.blind_4_tilt

  action:
  - service: ads.write_data_by_name
    data_template:
      adsvar: "{{ trigger.to_state.attributes.adsvar }}"
      adstype: byte
      value: "{{ trigger.to_state.state | int }}"

The input_number of each blind as a custom attribute assigned to it.
The friendly name of this attribute is adsvar, the value contains the ADS variable it needs to write to.

This worked perfectly in the previous version, but since the upgrade it stopped working.
The template

"{{ trigger.to_state.attributes.adsvar }}"

Doesn’t return any value anymore. Just ‘None’ in the logs.
What causes this?

Do the input number still have ADS as a custom attribute? I could imagine that this got overwritten when you updated.

Found the solution:

@Burningstone pointed me in the right direction.
Every time the input_number gets updated, the custom attributes disappear (maybe making this persistent is a post for the WTH month). To overcome this, I’ve used a separate automation that is triggered when the state of the input number changes. This automation re-sets the custom attributes.vThis was also used in the 0.112 version of my config.
Apparently the automation didn’t got triggered anymore since the latest update.
I used the ‘id’ of the automation to trigger it, changed this to it’s ‘alias’ value and it started working again.
I also use the trigger.from_state now, in stead of trigger.to_state to read the attribute.
Just to make sure that, during update, I still have access to the attributes value.