Automation - trigger not working - mqtt

Hi guys!

I would appreciate some help please.

I have automation as follows:

- id: ebusd38
  alias: Set Backup Mode Hwc
  trigger:
    - platform: state
      entity_id:
        - number.backup_mode_hwc
      attribute: mode
  action:
    - service: mqtt.publish
      data:
        topic: ebusd/ehp/BackupModeHwc/set
        payload: "{{ states.number.backup_mode_hwc.state | float }}"

The problem is that the automation is not triggering when I change the number.backup_mode_hwc .
If I trigger automation manually (f.i. in automation configuration) it works and mqtt publishes the topic with corresponding number.

Any suggestions?

Thanks!