Secondary_info: last-changed only show when binary_sensor.X is switched on

`entities:

  • entity: binary_sensor.door_window_sensor_158d0002027f13
  • entity: binary_sensor.motion_sensor_158d0002236c25
  • entity: binary_sensor.washmachine
    secondary_info: last-changed`

Any ideas on how to show secondary_info: last-changed only when binary_sensor.washmachine is switched on.